Is there any way to separate the VisualStateManager.VisualStateGroups into a ResourceDictionary ?
Basically I want something like
<VisualStateManager.VisualStateGroups x:Name="MyVisualGroups">
<VisualStateGroup x:Name="A" />
<VisualStateGroup x:Name="B" />
<VisualStateGroup x:Name="C" />
</VisualStateManager.VisualStateGroups>
but it obviously doesn’t work. Any way to make it work?
If you wrap them in a style objct, you should be able to make this work. Check out my answer to this question for an example of how the VSM stuff is wrapped to restyle the selected state in a listbox.
Note : I am not sure if that would work for a set of generic VisualStates, though. It does work for the whole of a listbox ItemContainerStyle settings, though.