I am trying to change the button Pressed background dynamically. But I am unable to access to this property from the code behind. According to the base style of button, I tried to get the ControlTemplate (by the TemplateProperty) but there is no method from it to retrieve the Grid (RootGrid) it contains. So I tried to get VisualStateGroup like this:
var visualStateGroups = VisualStateManager.GetVisualStateGroups(testButton);
But this returns null.
Thanks for any help.
Samuel