SoftFluent.Windows_net8 2.0.0

dotnet add package SoftFluent.Windows_net8 --version 2.0.0
                    
NuGet\Install-Package SoftFluent.Windows_net8 -Version 2.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="SoftFluent.Windows_net8" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftFluent.Windows_net8" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SoftFluent.Windows_net8" />
                    
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 SoftFluent.Windows_net8 --version 2.0.0
                    
#r "nuget: SoftFluent.Windows_net8, 2.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 SoftFluent.Windows_net8@2.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=SoftFluent.Windows_net8&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SoftFluent.Windows_net8&version=2.0.0
                    
Install as a Cake Tool

PropertyGrid

Nuget Version GitHub License Nuget Downloads

This repository contains useful controls/converter/classes to work with WPF. The current version of the library is also available on NuGet.

This repository contains a customizable PropertyGrid for WPF.

alternate text is missing from this package README image

  • Many data types are supported by default: String, Boolean, Date, DateTime, Number, Enum, Multi-Valued Enum, Byte[], Guid, etc.,
  • Property names are decamelized by default (FirstName ⇒ First Name) unless you use the DisplayNameAttribute,
  • Common attributes are supported: DisplayNameAttribute, CategoryAttribute, BrowsableAttribute, ReadOnlyAttribute,
  • Customizable:
    • CustomEditor = DataTemplate You can create your own editors to provide a better UX to your user (Slider, Url, Password, etc.) by creating a DataTemplate
<Grid>
    <Grid.Resources>
        <samples:Customer x:Key="Customer"/>
    </Grid.Resources>
    <windows:PropertyGrid xmlns:windows="clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows" 
                            SelectedObject="{StaticResource Customer}" />
</Grid>

Go to the documentation

AutoObject

The AutoObject class is a light class which implements INotifyPropertyChanged and IDataErrorInfo so you can easily and quickly create MVVM like classes with data-binding and validation

UniversalConverter

Stop writing boring converters, use the UniversalConverter!

When you create an application using WPF, you often have to write converters to change one value to the desired type. The .NET Framework already provides some basics converter such as BooleanToVisibilityConverter. These converters are very specifics and usually not very configurable. For example you cannot change the visibility from Collapsed to Hidden.

Let’s see how to use it for a very basic (and to be honest, quite useless) conversion:

<Window.Resources>
    <windows:UniversalConverter x:Key="TypeConversionUniversalConverter" />
</Window.Resources>
 
<CheckBox IsChecked="{Binding Converter={StaticResource TypeConversionUniversalConverter},
   Mode=OneWay}" DataContext="true"/>
<CheckBox IsChecked="{Binding Converter={StaticResource TypeConversionUniversalConverter}, 
   Mode=OneWay}" DataContext="yes"/>

In this example, UniversalConverter converts the value to the desired type so string values “true” and “yes” will be converted automatically to the Boolean value “true”.

With UniversalConverter, you can create a list of cases, like a C# switch. For instance, this is how we would reproduce the boolean to visibility converter behavior using the UniversalConverter:

<windows:UniversalConverter x:Key="BooleanToVisibilityConverter">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="Equal" Value="True" ConvertedValue="Visible" />
        <cfr:UniversalConverterCase Operator="Equal" Value="False" ConvertedValue="Collapsed" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Like C#, you can use a default value:

<cfr:UniversalConverter x:Key="BooleanToVisibilityConverter" DefaultValue="Visible">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="Equal" Value="False" ConvertedValue="Collapsed" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

There are currently these operators available:

  • Equal,
  • NotEqual,
  • GreaterThan,
  • GreaterThanOrEqual,
  • LesserThan,
  • LesserThanOrEqual,
  • Between: minimum and maximum value included ⇒ [min:max[,
  • StartsWith,
  • EndsWith,
  • Contains,
  • IsType: type match exactly,
  • IsOfType: type or direved types,
  • JavaScript: Yes, you can use JavaScript to evaluate a condition!

With some options:

  • StringComparison
  • Trim
  • Nullify

Here’s a list of examples using different operators.

Check if a string contains NewLine using JavaScript:

<cfr:UniversalConverter x:Key="HasMultipleLinesConverter" DefaultValue="False">
    <cfr:UniversalConverter.Switch>
        
        <cfr:UniversalConverterCase Value="/\r|\n/.exec(Value)!=null" ConvertedValue="True" Operator="Javascript" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Set error message background and foreground color

<cfr:UniversalConverter x:Key="ErrorTextBackgroundConverter" DefaultValue="Red">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Value="" ConvertedValue="Transparent" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>
<cfr:UniversalConverter x:Key="ErrorTextForegroundConverter" DefaultValue="White">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Value="" ConvertedValue="Black" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Test if a value is over 21

<cfr:UniversalConverter x:Key="IsOver21Converter" DefaultValue="false">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="GreaterThanOrEqual" Value="21" ConvertedValue="true" Options="Convert" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Is teenager

<cfr:UniversalConverter x:Key="IsTeenagerConverter" DefaultValue="false">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="Between" MinimumValue="13" MaximumValue="20" ConvertedValue="true" Options="Convert" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Compare types

<cfr:UniversalConverter x:Key="TypeConverter" DefaultValue="false">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="IsType" Value="System.String" ConvertedValue="Type = String" />
        <cfr:UniversalConverterCase Operator="IsType" Value="System.Int32" ConvertedValue="Type = int" />
        <cfr:UniversalConverterCase Operator="IsOfType" Value="BaseClass, MyAssembly" ConvertedValue="Type is of type BaseClass" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>

Is empty

<cfr:UniversalConverter x:Key="IsEmptyConverter" DefaultValue="Not empty">
    <cfr:UniversalConverter.Switch>
        <cfr:UniversalConverterCase Operator="Equal" Options="Trim, Nullify" ConvertedValue="Empty" />
    </cfr:UniversalConverter.Switch>
</cfr:UniversalConverter>
 
<TextBox x:Name="TextBox"/>
<TextBlock Text="{Binding ElementName=TextBox, Path=Text, Converter={StaticResource IsEmptyConverter}}" />
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SoftFluent.Windows_net8:

Package Downloads
AssemblyLibrary

Helpful Functions and Controls

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 213 9/11/2025