https://github.com/softfluent/softfluent.windows
https://github.com/softfluent/softfluent.windows
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/softfluent/softfluent.windows
- Owner: SoftFluent
- License: mit
- Created: 2015-06-22T12:48:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T09:45:30.000Z (almost 6 years ago)
- Last Synced: 2025-04-12T02:39:07.795Z (about 1 year ago)
- Language: C#
- Size: 639 KB
- Stars: 37
- Watchers: 8
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This repository contains useful controls/converter/classes to work with WPF. The current version of the library is also [available on NuGet](https://www.nuget.org/packages/SoftFluent.Windows/).
# PropertyGrid
This repository contains a customizable `PropertyGrid` for WPF.

- 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`
````xaml
````
Go to the [documentation](https://github.com/SoftFluent/SoftFluent.Windows/wiki)
# 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:
````xaml
````
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:
````xaml
````
Like C#, you can use a default value:
````xaml
````
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:
````xaml
````
### Set error message background and foreground color
````xaml
````
### Test if a value is over 21
````xaml
````
### Is teenager
````xaml
````
### Compare types
````xaml
````
### Is empty
````xaml
````