locked
Specify how to Animate Visibility Change in Style

    Question

  • Hello Everyone,

    I'm quite new to the whole world of Control Styling and despite instensive search I did not found any answer to my question so I decided to post it here.

    I defined a style for Button. Now I would like to specify the Storyboard to use when the Visibility of the Button changes. In Windows Store apps there is no Triggers as in WPF and I could not find any VisualState that matches my needs.

    Is it even possible? If yes would you be so kind to show me how?

    Many thansk in advance for your help!

    Bruno

    Friday, November 2, 2012 1:06 PM

Answers

All replies

  • You need define your VisualState and call VisualStateManager.GoToState in code to change the VisualState.

    You can find some more details at http://msdn.microsoft.com/en-us/library/cc964292(v=vs.95).aspx. It is for SL but most content should work for windows store app as well.

    Friday, November 2, 2012 5:09 PM
  • Thansk for your help!

    So your answer sounds to me like there is no way to do this only using Style definition: I'll have to build a control that inherits from Button and calls the GoToState method when the Visibility property is set?

    Friday, November 2, 2012 9:58 PM