BB84.WinForms.Extensions
2.11.409
dotnet add package BB84.WinForms.Extensions --version 2.11.409
NuGet\Install-Package BB84.WinForms.Extensions -Version 2.11.409
<PackageReference Include="BB84.WinForms.Extensions" Version="2.11.409" />
<PackageVersion Include="BB84.WinForms.Extensions" Version="2.11.409" />
<PackageReference Include="BB84.WinForms.Extensions" />
paket add BB84.WinForms.Extensions --version 2.11.409
#r "nuget: BB84.WinForms.Extensions, 2.11.409"
#addin nuget:?package=BB84.WinForms.Extensions&version=2.11.409
#tool nuget:?package=BB84.WinForms.Extensions&version=2.11.409
BB84.WinForms.Extensions
A collection of some WinForms extensions I needed in many projects. It consists of some useful control and dialog extension methods.
Usage
Depending on the application, there are several ways to skin a cat.
Bindings
On the 'TextBox', for example, the text, whether the 'TextBox' is active or even whether the 'TextBox' is visible or not can be configured using the extension methods. The same applies to the NumericUpDown control. At a 'ComboBox' control, for example, the data source and the selected item can be bound to a property.
/// <summary>
/// The character form class.
/// </summary>
public partial class CharacterForm : Form
{
private readonly CharacterViewModel _viewModel;
/// <summary>
/// Initializes a new instance of the <see cref="CharacterForm"/> class.
/// </summary>
/// <param name="viewModel">The character view model instance to use.</param>
public CharacterForm(CharacterViewModel viewModel)
{
InitializeComponent();
_viewModel = viewModel;
FirstNameTextBox.WithTextBinding(_viewModel.Model, nameof(_viewModel.Model.FirstName));
LastNameTextBox.WithTextBinding(_viewModel.Model, nameof(_viewModel.Model.LastName));
LevelNumericUpDown.WithValueBinding(_viewModel.Model, nameof(_viewModel.Model.Level));
ExperienceNumericUpDown.WithValueBinding(_viewModel.Model, nameof(_viewModel.Model.Experience))
.WithEnabledBinding(_viewModel, nameof(_viewModel.CanChangeExperience));
CritterComboBox.WithDataSource(_viewModel.CritterTypes)
.WithSelectedItemBinding(viewModel.Model, nameof(viewModel.Model.CritterType));
}
}
This applies to a lot of standard controls.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net9.0-windows7.0 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
-
.NETFramework 4.6.2
- No dependencies.
-
.NETFramework 4.8.1
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
-
net9.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.