This is expected behavior and comes from the framework. Let me try to explain. The RadDiagramToolbox derives from HeaderedItemsControl
class. So when you are using ItemContainerStyleSelector
a style will be applied to each generated container element. In your case, the group
and its corresponding group Items are generated when you run the application.
I have isolated this behavior using the Microsoft TreeView. The TreeViewItem derives from HeaderedItemsControl class.
In the CustomStyleSelector
class, you can observe the same behavior. First, the SelectStyle
method will be called for the parent groups (CustomGroup) then will be fired for children of the groups (CustomGroupItem).
Also in the attached project if you set the IsExpanded
property to False
of the parent the sub items will not be generated and the SelectStyle()
method of the CustomStyleSelector
will not be called.
Hope this information is helpful.
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin
, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.