{"id":18677667,"url":"https://github.com/softfluent/softfluent.windows","last_synced_at":"2025-08-25T10:14:56.907Z","repository":{"id":34067078,"uuid":"37854809","full_name":"SoftFluent/SoftFluent.Windows","owner":"SoftFluent","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-07T09:45:30.000Z","size":654,"stargazers_count":37,"open_issues_count":2,"forks_count":12,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-12T02:39:07.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SoftFluent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T12:48:04.000Z","updated_at":"2025-02-18T06:02:19.000Z","dependencies_parsed_at":"2022-07-16T13:16:03.625Z","dependency_job_id":null,"html_url":"https://github.com/SoftFluent/SoftFluent.Windows","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftFluent%2FSoftFluent.Windows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftFluent%2FSoftFluent.Windows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftFluent%2FSoftFluent.Windows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SoftFluent%2FSoftFluent.Windows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SoftFluent","download_url":"https://codeload.github.com/SoftFluent/SoftFluent.Windows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248507281,"owners_count":21115567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T09:34:40.091Z","updated_at":"2025-04-12T02:39:15.000Z","avatar_url":"https://github.com/SoftFluent.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"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/).\n\n# PropertyGrid\n\nThis repository contains a customizable `PropertyGrid` for WPF. \n\n![](https://github.com/SoftFluent/SoftFluent.Windows/wiki/Images/Getting-Started-Result.png)\n\n- Many data types are supported by default: String, Boolean, Date, DateTime, Number, Enum, Multi-Valued Enum, Byte[], Guid, etc.,\n- Property names are decamelized by default (FirstName =\u003e First Name) unless you use the `DisplayNameAttribute`,\n- Common attributes are supported: `DisplayNameAttribute`, `CategoryAttribute`, `BrowsableAttribute`, `ReadOnlyAttribute`,\n- Customizable: \n    - `CustomEditor` = `DataTemplate` You can create your own editors to provide a better UX to your user (Slider, Url, Password, etc.) by creating a `DataTemplate`\n\n````xaml\n\u003cGrid\u003e\n    \u003cGrid.Resources\u003e\n        \u003csamples:Customer x:Key=\"Customer\"/\u003e\n    \u003c/Grid.Resources\u003e\n    \u003cwindows:PropertyGrid xmlns:windows=\"clr-namespace:SoftFluent.Windows;assembly=SoftFluent.Windows\" \n                            SelectedObject=\"{StaticResource Customer}\" /\u003e\n\u003c/Grid\u003e\n````\n\nGo to the [documentation](https://github.com/SoftFluent/SoftFluent.Windows/wiki)\n\n# AutoObject\n\nThe `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\n\n# UniversalConverter\n\nStop writing boring converters, use the `UniversalConverter`!\n\nWhen you create an application using WPF, you often have to write converters to change one value to the desired type.\nThe .NET Framework already provides some basics converter such as BooleanToVisibilityConverter.\nThese converters are very specifics and usually not very configurable.\nFor example you cannot change the visibility from Collapsed to Hidden.\n\nLet’s see how to use it for a very basic (and to be honest, quite useless) conversion:\n\n\n````xaml\n\u003cWindow.Resources\u003e\n    \u003cwindows:UniversalConverter x:Key=\"TypeConversionUniversalConverter\" /\u003e\n\u003c/Window.Resources\u003e\n \n\u003cCheckBox IsChecked=\"{Binding Converter={StaticResource TypeConversionUniversalConverter},\n   Mode=OneWay}\" DataContext=\"true\"/\u003e\n\u003cCheckBox IsChecked=\"{Binding Converter={StaticResource TypeConversionUniversalConverter}, \n   Mode=OneWay}\" DataContext=\"yes\"/\u003e\n````\nIn 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”.\n\nWith 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:\n\n````xaml\n\u003cwindows:UniversalConverter x:Key=\"BooleanToVisibilityConverter\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"Equal\" Value=\"True\" ConvertedValue=\"Visible\" /\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"Equal\" Value=\"False\" ConvertedValue=\"Collapsed\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n\nLike C#, you can use a default value:\n\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"BooleanToVisibilityConverter\" DefaultValue=\"Visible\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"Equal\" Value=\"False\" ConvertedValue=\"Collapsed\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n\nThere are currently these operators available:\n\n* Equal,\n* NotEqual,\n* GreaterThan,\n* GreaterThanOrEqual,\n* LesserThan,\n* LesserThanOrEqual,\n* Between: minimum and maximum value included =\u003e [min:max[,\n* StartsWith,\n* EndsWith,\n* Contains,\n* IsType: type match exactly,\n* IsOfType: type or direved types,\n* JavaScript: Yes, you can use JavaScript to evaluate a condition!\n\nWith some options:\n\n* StringComparison\n* Trim\n* Nullify\n\nHere’s a list of examples using different operators.\n\n### Check if a string contains NewLine using JavaScript:\n\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"HasMultipleLinesConverter\" DefaultValue=\"False\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003c!--look for a CR or LF in the string string--\u003e\n        \u003ccfr:UniversalConverterCase Value=\"/\\r|\\n/.exec(Value)!=null\" ConvertedValue=\"True\" Operator=\"Javascript\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n\n### Set error message background and foreground color\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"ErrorTextBackgroundConverter\" DefaultValue=\"Red\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Value=\"\" ConvertedValue=\"Transparent\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n\u003ccfr:UniversalConverter x:Key=\"ErrorTextForegroundConverter\" DefaultValue=\"White\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Value=\"\" ConvertedValue=\"Black\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n### Test if a value is over 21\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"IsOver21Converter\" DefaultValue=\"false\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"GreaterThanOrEqual\" Value=\"21\" ConvertedValue=\"true\" Options=\"Convert\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n### Is teenager\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"IsTeenagerConverter\" DefaultValue=\"false\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"Between\" MinimumValue=\"13\" MaximumValue=\"20\" ConvertedValue=\"true\" Options=\"Convert\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n### Compare types\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"TypeConverter\" DefaultValue=\"false\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"IsType\" Value=\"System.String\" ConvertedValue=\"Type = String\" /\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"IsType\" Value=\"System.Int32\" ConvertedValue=\"Type = int\" /\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"IsOfType\" Value=\"BaseClass, MyAssembly\" ConvertedValue=\"Type is of type BaseClass\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n````\n### Is empty\n````xaml\n\u003ccfr:UniversalConverter x:Key=\"IsEmptyConverter\" DefaultValue=\"Not empty\"\u003e\n    \u003ccfr:UniversalConverter.Switch\u003e\n        \u003ccfr:UniversalConverterCase Operator=\"Equal\" Options=\"Trim, Nullify\" ConvertedValue=\"Empty\" /\u003e\n    \u003c/cfr:UniversalConverter.Switch\u003e\n\u003c/cfr:UniversalConverter\u003e\n \n\u003cTextBox x:Name=\"TextBox\"/\u003e\n\u003cTextBlock Text=\"{Binding ElementName=TextBox, Path=Text, Converter={StaticResource IsEmptyConverter}}\" /\u003e\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftfluent%2Fsoftfluent.windows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftfluent%2Fsoftfluent.windows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftfluent%2Fsoftfluent.windows/lists"}