WEB开发网
开发学院图形图像Flash Silverlight and the VisualStateManager 阅读

Silverlight and the VisualStateManager

 2008-10-24 11:46:25 来源:WEB开发网   
核心提示: The VSM model also enables you to move between states via code.VisualStateManager.GoToState() is a static method that enables you to move between

The VSM model also enables you to move between states via code. VisualStateManager.GoToState() is a static method that enables you to move between states and optionally use the transition or just get to the state. For example if we had our Button named "foo" and had some other event we could do this:

VisualStateManager.GoToState(foo, "MouseOver", true);

The last parameter is to use the transition or not. True would do the transition based on the duration set in that state. False just gets to that state.

The theory is that VisualStateManager now makes it easy for us with our skinning, etc., but also separates more from the developer/designer so that the designer can concentrate on the final look and experience of the final states rather than having to code something up.

A Button used above is a simple example and I hope it helps demonstrate the VSM class available. There could be other uses than the simple Button of course :-) and I hope to see some creative uses. As a for instance, I've seen a lot of applications with slide-out control panel implementations. You could use VisualStateManager and set the "collapsed" and "open" states for a control panel and just concentrate on the final stages of each and let VSM handle the transitions, etc. 

For some further designer-driven tutorials on this model, head on over to Nibbles where Celso will have some tutorials on what VSM means to designers in more depth. Also be sure to check out Christian’s blog for more information on VisualStateManager.

Hope this helps!

上一页  1 2 3 4 

Tags:Silverlight and the

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接