{"id":21129501,"url":"https://github.com/guorg/gu.wpf.propertygrid","last_synced_at":"2026-02-12T01:23:56.426Z","repository":{"id":144199086,"uuid":"45797994","full_name":"GuOrg/Gu.Wpf.PropertyGrid","owner":"GuOrg","description":"Small lib with styles for using ItemsControl as a property grid.","archived":false,"fork":false,"pushed_at":"2022-03-05T16:59:57.000Z","size":1203,"stargazers_count":25,"open_issues_count":16,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-09T12:18:02.152Z","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/GuOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-08T20:37:45.000Z","updated_at":"2023-09-21T04:19:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b100dc88-b771-48ec-9a15-c7bfc962f917","html_url":"https://github.com/GuOrg/Gu.Wpf.PropertyGrid","commit_stats":null,"previous_names":["johanlarsson/gu.wpf.propertygrid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.PropertyGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.PropertyGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.PropertyGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.PropertyGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuOrg","download_url":"https://codeload.github.com/GuOrg/Gu.Wpf.PropertyGrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225473125,"owners_count":17479734,"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-20T05:23:55.174Z","updated_at":"2026-02-12T01:23:56.384Z","avatar_url":"https://github.com/GuOrg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gu.PropertyGrid\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)\n[![Build status](https://ci.appveyor.com/api/projects/status/vhg6ru7ennq82ek7/branch/master?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-wpf-propertygrid/branch/master)\n[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.PropertyGrid.svg)](https://www.nuget.org/packages/Gu.Wpf.PropertyGrid/)\n[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.PropertyGrid.NumericSettingControls.svg)](https://www.nuget.org/packages/Gu.Wpf.PropertyGrid.NumericSettingControls/)\n[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.PropertyGrid.UnitSettingControls.svg)](https://www.nuget.org/packages/Gu.Wpf.PropertyGrid.UnitSettingControls/)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JohanLarsson/Gu.Wpf.PropertyGrid?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nLibrary with controls for making property grids\n\n**Note:** Master branch \u0026 docs are not in sync with the nuget, sry about this.\n\n## Sample\n\n```xaml\n\u003cGrid validationScope:Scope.ForInputTypes=\"Scope\" validationScope:Scope.HasErrorsOneWayToSourceBinding=\"{Binding ViewHasErrors, Mode=OneWayToSource}\"\u003e\n    \u003cGrid.RowDefinitions\u003e\n        \u003cRowDefinition /\u003e\n        \u003cRowDefinition Height=\"Auto\" /\u003e\n    \u003c/Grid.RowDefinitions\u003e\n    \u003cpropertyGrid:Rows Grid.Row=\"0\"\n                        DataContext=\"{Binding EditableCopy}\"\n                        OldDataContext=\"{Binding DataContext.LastSaved,\n                                                RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}\"\u003e\n        \u003cTextBlock Style=\"{StaticResource HeaderTextBlockStyle}\" Text=\"Core\" /\u003e\n\n        \u003cpropertyGrid:StringRow Header=\"string\" Value=\"{Binding StringValue}\" /\u003e\n\n        \u003cpropertyGrid:StringRow Header=\"readonly string\"\n                                IsReadOnly=\"True\"\n                                Value=\"{Binding StringValue}\" /\u003e\n\n        \u003cpropertyGrid:CheckBoxRow Header=\"INotifyDataErrorInfo has error\" Value=\"{Binding HasErrors, ValidatesOnNotifyDataErrors=True}\" /\u003e\n\n        \u003cpropertyGrid:CheckBoxRow Header=\"checkbox\" Value=\"{Binding BoolValue}\" /\u003e\n        \u003cpropertyGrid:BoolRow Header=\"bool\" Value=\"{Binding BoolValue}\" /\u003e\n\n        \u003cpropertyGrid:ToggleButtonRow Header=\"togglebutton\" Value=\"{Binding BoolValue}\" /\u003e\n\n\n        \u003cpropertyGrid:EnumRow Header=\"enum\" Value=\"{Binding CurrentStringComparison}\" /\u003e\n\n        \u003cpropertyGrid:SelectorRow Header=\"selector\"\n                                    ItemsSource=\"{x:Static demo:SettingsVm.LengthUnits}\"\n                                    Value=\"{Binding CurrentLengthUnit}\" /\u003e\n\n        \u003cpropertyGrid:ComboBoxRow Header=\"combobox\"\n                                    ItemsSource=\"{x:Static demo:SettingsVm.LengthUnits}\"\n                                    Value=\"{Binding CurrentLengthUnit}\" /\u003e\n            \n        \u003cpropertyGrid:ContentRow Header=\"content\"\u003e\n            \u003cButton Command=\"{Binding DataContext.SaveCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}\" Content=\"Save\" /\u003e\n        \u003c/propertyGrid:ContentRow\u003e\n\n        \u003cTextBlock Style=\"{StaticResource HeaderTextBlockStyle}\" Text=\"Numeric\" /\u003e\n\n        \u003cpropertyGrid:IntRow Header=\"int\" Value=\"{Binding IntValue}\" /\u003e\n\n        \u003cpropertyGrid:IntRow Header=\"readonly int\"\n                                IsReadOnly=\"True\"\n                                Value=\"{Binding IntValue}\" /\u003e\n\n        \u003cpropertyGrid:IntRow CanValueBeNull=\"True\"\n                                Header=\"int?\"\n                                Value=\"{Binding NullableIntValue}\" /\u003e\n\n        \u003cpropertyGrid:DoubleRow Header=\"double\" Value=\"{Binding DoubleValue}\" /\u003e\n\n        \u003cpropertyGrid:DoubleRow Header=\"readonly double\"\n                                IsReadOnly=\"True\"\n                                Value=\"{Binding DoubleValue}\" /\u003e\n\n        \u003cpropertyGrid:DoubleRow CanValueBeNull=\"True\"\n                                Header=\"double?\"\n                                Value=\"{Binding NullableDoubleValue}\" /\u003e\n\n        \u003cTextBlock Style=\"{StaticResource HeaderTextBlockStyle}\" Text=\"Units\" /\u003e\n\n        \u003cpropertyGrid:LengthRow Header=\"Length\" Value=\"{Binding LengthValue}\" /\u003e\n\n        \u003cpropertyGrid:LengthRow Header=\"readonly length\"\n                                IsReadOnly=\"True\"\n                                Value=\"{Binding LengthValue}\" /\u003e\n\n        \u003cpropertyGrid:LengthRow CanValueBeNull=\"True\"\n                                Header=\"Nullable length\"\n                                Value=\"{Binding NullableLengthValue}\" /\u003e\n\n        \u003cpropertyGrid:SpeedRow Header=\"Speed (readonly)\"\n                                IsReadOnly=\"True\"\n                                Unit=\"km/h\"\n                                Value=\"{Binding SpeedValue}\" /\u003e\n\n        \u003cpropertyGrid:LengthRow DecimalDigits=\"2\"\n                                Header=\"Length\"\n                                MaxValue=\"15 mm\"\n                                MinValue=\"-15 mm\"\n                                Unit=\"{Binding CurrentLengthUnit}\"\n                                Value=\"{Binding LengthValue}\" /\u003e\n    \u003c/propertyGrid:Rows\u003e\n\n    \u003cGrid Grid.Row=\"1\"\u003e\n        \u003cGrid.ColumnDefinitions\u003e\n            \u003cColumnDefinition /\u003e\n            \u003cColumnDefinition /\u003e\n        \u003c/Grid.ColumnDefinitions\u003e\n        \u003cButton Grid.Column=\"0\"\n                Command=\"{Binding SaveCommand}\"\n                Content=\"Save\" /\u003e\n        \u003cButton Grid.Column=\"1\"\n                Command=\"{Binding UndoAllCommand}\"\n                Content=\"Undo\" /\u003e\n    \u003c/Grid\u003e\n\u003c/Grid\u003e\n```\n\nRenders:\n\n![Render](http://i.stack.imgur.com/DkWs1.gif)\n\n## AttachedProperties\n### Grid\nMade RowDefinitions \u0026 ColumnDefinitions attached properties so that the grid can be styled if many grids need the same rows and columns.\n\n##### Sample style\n\nWhen used in a style either the style must have `x:Shared=\"False\"` or the rows and columns can be declared with `x:Shared=\"False\"` like this:\nAbout [x:Shared](https://msdn.microsoft.com/en-us/library/aa970778(v=vs.110).aspx) in short it means that instances in resources are not reused.\n\n```\n\u003cpropertyGrid:RowDefinitions x:Key=\"RowDefinitions\" x:Shared=\"False\"\u003e\n    \u003cRowDefinition Height=\"Auto\" /\u003e\n    \u003cRowDefinition Height=\"Auto\" /\u003e\n\u003c/propertyGrid:RowDefinitions\u003e\n\n\u003cpropertyGrid:ColumnDefinitions x:Key=\"ColumnDefinitions\" x:Shared=\"False\"\u003e\n    \u003cColumnDefinition SharedSizeGroup=\"{x:Static propertyGrid:SharedSizeGroups.LabelColumn}\" /\u003e\n    \u003cColumnDefinition MinWidth=\"{Binding Path=(propertyGrid:SettingControl.ValueMinWidth),\n                                            RelativeSource={RelativeSource AncestorType={x:Type propertyGrid:SettingControlBase}}}\"\n                        MaxWidth=\"{Binding Path=(propertyGrid:SettingControl.ValueMaxWidth),\n                                            RelativeSource={RelativeSource AncestorType={x:Type propertyGrid:SettingControlBase}}}\"\n                        SharedSizeGroup=\"{x:Static propertyGrid:SharedSizeGroups.ValueColumn}\" /\u003e\n    \u003cColumnDefinition MinWidth=\"{Binding Path=(propertyGrid:SettingControl.SuffixMinWidth),\n                                            RelativeSource={RelativeSource AncestorType={x:Type propertyGrid:SettingControlBase}}}\"\n                        MaxWidth=\"{Binding Path=(propertyGrid:SettingControl.SuffixMaxWidth),\n                                            RelativeSource={RelativeSource AncestorType={x:Type propertyGrid:SettingControlBase}}}\"\n                        SharedSizeGroup=\"{x:Static propertyGrid:SharedSizeGroups.SuffixColumn}\" /\u003e\n\u003c/propertyGrid:ColumnDefinitions\u003e\n\n\u003cStyle x:Key=\"{x:Static propertyGrid:Keys.RootGridStyleKey}\" TargetType=\"{x:Type Grid}\"\u003e\n    \u003cSetter Property=\"propertyGrid:Grid.RowDefinitions\" Value=\"{StaticResource RowDefinitions}\" /\u003e\n    \u003cSetter Property=\"propertyGrid:Grid.ColumnDefinitions\" Value=\"{StaticResource ColumnDefinitions}\" /\u003e\n\u003c/Style\u003e\n```\n\n##### Xaml sample\nWrote typeconverters so that they can be used in xaml like this:\n\n```\n\u003cGrid p:Grid.ColumnDefinitions=\"* *\" p:Grid.RowDefinitions=\"* *\"\u003e\n    \u003cRectangle Grid.Row=\"0\"\n               Grid.Column=\"0\"\n               Fill=\"Blue\" /\u003e\n    \u003cRectangle p:Grid.Cell=\"1 1\"\n               Fill=\"Yellow\" /\u003e\n\u003c/Grid\u003e\n```\n\n### OneWayToSource\nAttached property that lets you bind readonly dependency properties `OneWayToSource`to datacontes.\n\n##### Sample\n```\n\u003cTextBox Text=\"{Binding Text}\"\n         p:OneWayToSource.Bind=\"{p:Paths From={x:Static Validation.HasErrorProperty},\n                                         To=ViewHasErrors}\" /\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguorg%2Fgu.wpf.propertygrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguorg%2Fgu.wpf.propertygrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguorg%2Fgu.wpf.propertygrid/lists"}