How do I programmatically get the current Visual State of a WPF FrameworkElement?

前端 未结 3 798
一整个雨季
一整个雨季 2021-02-19 10:47

How do I programmatically get the current Visual State of a WPF FrameworkElement? And by state I mean the states like \"Normal\", \"MouseOver\", \"Disabled\", etc.

EDIT:

3条回答
  •  粉色の甜心
    2021-02-19 11:27

    I think you should use GoToElementState method instead of GoToState method.

    VisualStateManager.GoToElementState(LayoutRoot, "Add", true);
    

提交回复
热议问题