Tuesday, 15 March 2011

xaml - How to disable/enable a VisualState based on some condition? (Metro) -



xaml - How to disable/enable a VisualState based on some condition? (Metro) -

i defined visualstate button in controltemplate:

class="lang-xml prettyprint-override"> <controltemplate x:key="buttontemplate" targettype="button"> ... <visualstatemanager.visualstategroups> <visualstategroup x:name="commonstates"> ... <visualstate x:name="pointerover"> <storyboard> <doubleanimation storyboard.targetname="c1" storyboard.targetproperty="opacity" to="0.7"/> </storyboard> </visualstate> ... </visualstategroup> </visualstatemanager.visualstategroups> ... </controltemplate>

but effect (change opacity when mouseover) should enabled/disabled based on viewmodel condition, how do xaml?

i tried creating binding value of doubleanimation, doesn't work because storyboard freezed. i'm thinking sth template selector, there no such thing visualstate manager.

i discussing , might add together generic solution problem winrt xaml toolkit, work similar datatriggers wpf, add together dependencyproperty control, bind property view model , on value alter - update visual state.

xaml windows-runtime windows-store-apps visualstatemanager

No comments:

Post a Comment