Silverlight and the VisualStateManager
2008-10-24 11:46:25 来源:WEB开发网I’m selecting the BackgroundGradient element and then changing the color within the Properties palette. Let’s change it to red. There is no need for me to pay attention to any timeline stop points or anything, just concentrate on what I want the final Button to look like, position, etc. in this state:
That’s it. MouseOver will now represent my new state. I didn’t have to create any new StoryBoard elements or anything. This is in part where VSM does some magic. You see, the VSM engine bascially knows the beginning end states between any given transition (i.e., Normal –> MouseOver). The VSM engine automatically handles the transition for us. Think of it as creating a dynamic StoryBoard on the fly and executing it. If we run the application and mouse over the Button, it changes to our state.
Notice the time in the state palette for a given state:
This controls the duration of the transition TO that final state.
Tags:Silverlight and the
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接