Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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: Basically, I am changing the Visual state of a button with VisualStateManager.GoToState(e, "MouseOver", true);, and I want to know what state to change it back to after I am done.

like image 690
Kyle Avatar asked Jan 14 '10 15:01

Kyle


1 Answers

I think you have to know/remember the button state by yourself. VSM just displays the state in which the button is by GoToState method.

Edit: I've just found an article how to create a custom VSM that remembers control states.

like image 105
Lukas Cenovsky Avatar answered Oct 20 '22 03:10

Lukas Cenovsky