Try to do this in a own PropertyGrid class, but dont work:
using System;
using System.Windows;
using System.Windows.Controls.Primitives;
using Syncfusion.Windows.PropertyGrid;
using Syncfusion.Windows.Shared;
namespace ibKastl.MD3.Gui.UserControls.PropertyGrid
{
class MD3PropertyGrid : Syncfusion.Windows.PropertyGrid.PropertyGrid
{
public MD3PropertyGrid() : base()
{
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
if (VisualUtils.FindDescendant(this, typeof(PropertyView)) is PropertyView item)
{
item.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
}
}
private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
{
foreach (PropertyCatagoryViewItem item in VisualUtils.EnumChildrenOfType(this, typeof(PropertyCatagoryViewItem)))
{
item.IsExpanded = true;
foreach (var items in item.Items)
{
foreach (PropertyViewItem propertyviewitem in VisualUtils.EnumChildrenOfType(this, typeof(PropertyViewItem)))
{
ToggleButton button = (ToggleButton)propertyviewitem.Template.FindName("PART_Toggle", propertyviewitem);
if (button.Visibility == System.Windows.Visibility.Visible)
{
button.IsChecked = true;
}
}
}
}
}
}
}