-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PriorityGrid: flattening, priority and hierarchy sorting, nullable types, search bar hiding and fixes #892
base: master
Are you sure you want to change the base?
Conversation
Types which do not have a known type editor are browsed and flattened into the highest level as if their properties belong in the class that is currently handled by the PropertyGrid. Furthermore some flatting options are available to decide in which category to place the flattened properties and how to name that category. While the flattening is off by default to keep the default behavior, the demo has been extented to do apply flattening.
Introduces a dependency property ShowSearchBar in order to hide the search bar. The search bar XAML mark up has been updated to adjust the visibility accordingly. Furthermore, multibinding is used to collapse the dockpanel visbility if the search bar and the sort buttons are both hidden. To support that the BooleanArr2VisibilityConverter has been extented to optionally return a visible state if any of the bindings are visible (instead of all). For that the ConverterParameter can be set to 'UseAny'.
…earch bar. The search bar XAML mark up has been updated to adjust the visibility accordingly. Furthermore, multibinding is used to collapse the dockpanel visbility if the search bar and the sort buttons are both hidden. To support that the BooleanArr2VisibilityConverter has been extented to optionally return a visible state if any of the bindings are visible (instead of all). For that the ConverterParameter can be set to 'UseAny'.
…yControl into Hide-SearchBar
Flattening property grid
Hide search bar
Properties are ordered based on their level in the class hierarchy.
PropertyGrid: this introduces hierarchy level sorting (assumes flattening properties).
…refore elements were bound incorrectly and did not update the actual element values. Also adds some instance data to the demo model.
PropertyGrid: Fixes that the root component is assigned to the PropertyItem
PropertyGrid: Nullable types support
PropertyGrid: Fix custom editor support
…-Description Enum type editor now uses and favors existing enum entry descriptions.
In default, set Window.SizeToContent to Width or Height or WidthAndHeight, when the content size changed, the window will not re-center to screen or owner. After add this attached property, it will auto re-center.
…ttached-property Add KeepCenterOnSizeChanged attached property
Fixes a crash scenario when the enum was not set or null
Also fixes a bug when CraeteDefaultEditor was called (type was not referenced so it didn't update to be the underlying type).
Added support for GroupHeaderTemplate and GroupHeaderMargin
Sorting for priority, hierarchy level and default sorting mode added PropertyGrid can now be derived from requiring only a simple style base definition on the client side PropertyResolver now exposes more virtual functions to correctly use it for custom resolutions Fixes a flattening issue when no editor attribute was used Fixes search bar case sensitivity issue
New sorting options and extentability
Flatteing sorting extentibility
I noticed that your previous pr contained the following string: 'Copyright (C) Xion GmbH', so I would like to ask is there a copyright problem with these code? |
This was the default template of the company I am working at, whenever I create a new file this header is auto-added. Being in pandemic home office, this also applies at home. I simply forgot to remove them from the aforementioned files for the former pr. This PR should be clean. None of this code is related in any way to the company I work at. I currently reference my fork branch at work as I use it in production for one of our inhouse tools. We have a lot more features and extensions implemented at work for the PropertyGrid though, which I cannot share of course because that is property of the company I work at. |
…o-uninitialised-carousel Fixes crash when adding items to a carousel that was not initialised …
Is there any reason to not merge this? @NaBian |
I know this is a huge PR making it harder to review but still wanted to contribute the changes in one row because there is some overlapping stuff.
This PR introduces the following new features to the PropertyGrid:
This PR changes the following:
This PR fixes the following bugs:
Unknown type flattening
Types which do not have a known type editor are usually shown as a ReadOnlyTextBox which is inappropriate for almost any complex type. One could write an own custom editor but that's not always desired or possible.
This PR introduces flattening of "unknown" types (unknown as in no type editor available).
Child type properties are browsed and flattened into the highest level as if their properties belonged in the class that is currently handled by the PropertyGrid.
Furthermore some flattening options are available to decide in which category to place the flattened properties and how to name that category.
Flattening options:
While the flattening is off by default to keep the default behavior, the demo has been extented to apply flattening.
Here is the result of
Flattening.ParentNameAsCategory
with the PropertyGrid demo model.Hide Search Bar
This Introduces a dependency property
ShowSearchBar
in order to hide the search bar.The search bar XAML mark up has been updated to adjust the visibility accordingly.
Furthermore, multibinding is used to collapse the dockpanel visbility if the search bar and the sort buttons are both hidden.
To support that the
BooleanArr2VisibilityConverter
has been extented to optionally return a visible state if any of the bindings are visible (instead of all). For that the ConverterParameter can pass"UseAny"
Only show sort buttons, i.e.
ShowSearchBar="False" ShowSortButton="True"
Collapsed Dock Panel if all hidden, i.e.
ShowSearchBar="False" ShowSortButton="False"
Default Sorting Mode
This Introduces a dependency property
DefaultSorting
and enumSortingMode
in order to set the default sorting mode.Use
DefaultSorting="Category"
SortingMode options
Sorting by hierarchy level
This is a flattening related sorting mode. If an unknown type is flattened, its properties are one hierarchy level deeper.
The sorting mode allows to have deeper level properties be ordered after all higher level properties.
The hierarchy level can be explicitly set by using the added
HierarchyLevelAttribute
on any property. The input value is an integer describing the hierarchy level of that property.Sorting by priority
This uses the added
PriorityAttribute
to allow explicit order of property items.By default all items are assumed to have a priority of 0 and will be sorted just as before by the main sorting modes (category, name, hierarchy level).
By adding a
[Priority(1)]
to a property, this will order that property to the top of the sorting chain, before all properties with a priority < 1.TextBox instead of TextBlock as Title
The
PropertyGridBaseStyle
has been changed to use a TextBox instead of a TextBlock for the Title element.This allows to support the hc:TitleElement.Necessary attached property. An according dependency property for
IsNecessary
was added to the PropertyItem which value is resolved by thePropertyResolver
using the addedNecessaryAttribute
.So by adding
[Necessary]
to a property, this will show the required field symbol. Here is an example: