Benday.Presentation.Wpf
3.0.0
dotnet add package Benday.Presentation.Wpf --version 3.0.0
NuGet\Install-Package Benday.Presentation.Wpf -Version 3.0.0
<PackageReference Include="Benday.Presentation.Wpf" Version="3.0.0" />
<PackageVersion Include="Benday.Presentation.Wpf" Version="3.0.0" />
<PackageReference Include="Benday.Presentation.Wpf" />
paket add Benday.Presentation.Wpf --version 3.0.0
#r "nuget: Benday.Presentation.Wpf, 3.0.0"
#:package Benday.Presentation.Wpf@3.0.0
#addin nuget:?package=Benday.Presentation.Wpf&version=3.0.0
#tool nuget:?package=Benday.Presentation.Wpf&version=3.0.0
Benday.Presentation.Wpf - WPF MVVM Toolkit and Controls
WPF controls that bind to a whole field view model with one binding, plus value converters,
styles and a MessageBox-based IMessageManager. Built on
Benday.Presentation.Core, the
same view models the .NET MAUI packages use.
Written by Benjamin Day
Pluralsight Author | Microsoft MVP
https://www.benday.com
https://www.honestcheetah.com
info@benday.com
YouTube: https://www.youtube.com/@_benday
📖 New book: Azure Cosmos DB for .NET Developers: From Document Thinking to Production Patterns — It's the book on Cosmos DB for .NET developers! Document modeling with aggregate roots, hierarchical partition keys, request unit economics, Change Feed patterns, and a complete production case study — all in C# and ASP.NET Core.
Key Features
- TextboxField - Single-line text input for a
ViewModelField(string, int or DateTime) - TextEditorField - Multi-line text input with wrapping, scrolling and spell check
- ComboboxField - Drop-down bound to a
SingleSelectListViewModelorSelectableCollectionViewModel - ListboxField - List box bound to the same view models
- LabelField - Read-only value
- MessageBoxMessageManager -
IMessageManagerthat shows aMessageBoxowned by the active window, from any thread - Value converters -
VisibilityValueConverter,NotVisibilityValueConverter,VisibleIfNullValueConverter,VisibleIfNotNullValueConverter,SmartValueConverter,ShortDateValueConverter,StringFormatValueConverter,StringOrInt32ValueConverter,ToUpperCaseValueConverter
Every field control shows its label, hides when the view model's IsVisible is false,
disables when IsEnabled is false, and shows ValidationMessage when IsValid is false.
Installing
dotnet add package Benday.Presentation.Wpf
Quick Start
<Window xmlns:controls="clr-namespace:Benday.Presentation.Wpf.Controls;assembly=Benday.Presentation.Wpf">
<StackPanel>
<controls:TextboxField LabelText="First Name" DataContext="{Binding FirstName}" />
<controls:TextboxField LabelText="Age" DataContext="{Binding Age}" />
<controls:ComboboxField LabelText="Country" DataContext="{Binding Country}" />
<Button Content="Save" Command="{Binding SaveCommand}" />
</StackPanel>
</Window>
using Benday.Presentation.Wpf;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = new PersonViewModel(new MessageBoxMessageManager());
}
}
The view model is plain .NET (see Benday.Presentation.Core for PersonViewModel), so it
can be unit tested without WPF.
Styles
The controls need no setup: they carry their own default styles. To change how they look,
define a style with one of these keys in Application.Resources: FieldLabelStyle,
FieldErrorStyle, FieldValueLabelStyle, FieldTextboxStyle, FieldTextEditorStyle,
FieldComboBoxStyle, FieldListBoxStyle. Defining FieldLabelStyle tells the controls the
application has its own styles, so define all the ones you use.
To use the styles or the converters in your own XAML, merge the dictionary:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Benday.Presentation.Wpf;component/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
That gives you VisibilityValueConverterInstance, NotVisibilityValueConverterInstance,
VisibleIfNullValueConverterInstance, VisibleIfNotNullValueConverterInstance,
ToUpperCaseValueConverterInstance, ShortDateValueConverterInstance and
SmartValueConverterInstance.
Documentation
Full documentation: https://benday-inc.github.io/mvvm-presentation/
Suggestions, Problems, or Bugs?
Got ideas for features you'd like to see? Found a bug? Let us know by submitting an issue https://github.com/benday-inc/mvvm-presentation/issues. Want to contribute? Submit a pull request.
Related Packages
- Benday.Presentation.Core - The view models (required dependency)
- Benday.Presentation and Benday.Presentation.Controls - The .NET MAUI equivalents
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. net11.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Benday.Presentation.Core (>= 3.0.0)
-
net11.0-windows7.0
- Benday.Presentation.Core (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 0 | 12/4/2026 |
v3.0.0 - First release. WPF controls, value converters, styles and MessageBoxMessageManager for the Benday.Presentation view models, for .NET 10 and .NET 11. The version number matches the Benday.Presentation.Core release it is built on.