I've overried ICategoryDataAccessor CreateCategoryDataAccessor. So may be I am doing something wrong, but this method is used only when I load Categories, and later, when I change property's visibility, this method is not called. In the code you can see that createCategoryDataAccessor launches when I load properties, and when I change property value and visibility(dataAccessors = base.GetProperties(value, options);) this overriden method is not launching.
}
else
{
// Fall back to using the base method's results for nested objects
dataAccessors = base.GetProperties(value, options);
}
return dataAccessors;
}
protected override ICategoryDataAccessor CreateCategoryDataAccessor(string displayName)
{
return new CustomCategoryDescriptorDataAccessor(displayName);
}
And my xaml is :
<Style TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}">
<Style.Triggers>
<Trigger Property="DataAccessorType" Value="Category">
<Setter Property="Visibility" Value="{Binding RelativeSource={RelativeSource Self}, Path=DataContext.IsCategoryVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</Trigger>
<Trigger Property="DataAccessorType" Value="Property">
<Setter Property="Visibility" Value="{Binding RelativeSource={RelativeSource Self}, Path=DataContext.IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Trigger>
</Style.Triggers>
</Style>
And secondly property IsCategoryVisible is applaying to all categories, and not to each specific category.
Any ideas how to solve this?