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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Benday.Presentation.Wpf" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Benday.Presentation.Wpf" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Benday.Presentation.Wpf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Benday.Presentation.Wpf --version 3.0.0
                    
#r "nuget: Benday.Presentation.Wpf, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Benday.Presentation.Wpf@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Benday.Presentation.Wpf&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Benday.Presentation.Wpf&version=3.0.0
                    
Install as a Cake Tool

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.

NuGet License: MIT

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 SingleSelectListViewModel or SelectableCollectionViewModel
  • ListboxField - List box bound to the same view models
  • LabelField - Read-only value
  • MessageBoxMessageManager - IMessageManager that shows a MessageBox owned 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.

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible.  net11.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.