Closed ykarpeev closed 5 months ago
Revision: d1fec45aa1990d98aa729cdb0b52e269679b17c9 Author: bodong Date: 2024/6/3 9:57:37 Message: fix : https://github.com/bodong1987/Avalonia.PropertyGrid/issues/29
Modified: Avalonia.PropertyGrid/Controls/PropertyGrid.axaml.cs Modified: Avalonia.PropertyGrid/ViewModels/PropertyGridViewModel.cs
I noticed that ShowStyle="Alphabetic" does not sort alphabetically but by their order in the viewmodel.
If I have this view model:
It is sorted like this:
I changed BuildAlphabeticPropertiesView in PropertyGrid.axaml.cs to sort alphabetically by displayname to test:
Not sorting alphabetically is actually what I am trying to do so the functionality works well for me - but I am seeing if I can sort by some explicit attribute like [Display(Order = 0)] rather than just the sequence of the property.
I figured out one way to sorder by order property here:
https://github.com/ykarpeev/Avalonia.PropertyGrid/commit/ef972f603b3c799a902bbb4f5d49d333494dd803?diff=split&w=1