Silverlight behavior 实现3D来回跳动
2009-09-22 12:34
218 查看
Time for a brief but fun post... some time back Tim Heuer posted the Silverlight 3 bouncing plane gratuitous demo. Click an element, and the nearest corner would bounce backwards and forwards as it comes back to rest.
Tim had the code to setup the storyboards, and handle the mouse interaction in code-behind. I look at it, and immediately see a reusable component (even if it is a gratuitous one), or more specifically a behavior, that encapsulates all the logic, and can be attached declaratively in XAML to one or more elements simply without needing any code-behind logic. So I created one such behavior. I used this behavior in my TwitterBug sample at TechEd recently, and thought it could use a dedicated blog post. :-)
Here is a screenshot, which really doesn’t do much justice to something interactive. So go ahead, and click it to run the sample live. Click around on the images. And if you’re wondering how its done, go ahead and download the code. You’ll see a BouncingPlane class that derives from Behavior......
详细查看......
http://www.nikhilk.net/BouncingPlane-Behavior.aspx
Tim had the code to setup the storyboards, and handle the mouse interaction in code-behind. I look at it, and immediately see a reusable component (even if it is a gratuitous one), or more specifically a behavior, that encapsulates all the logic, and can be attached declaratively in XAML to one or more elements simply without needing any code-behind logic. So I created one such behavior. I used this behavior in my TwitterBug sample at TechEd recently, and thought it could use a dedicated blog post. :-)
Here is a screenshot, which really doesn’t do much justice to something interactive. So go ahead, and click it to run the sample live. Click around on the images. And if you’re wondering how its done, go ahead and download the code. You’ll see a BouncingPlane class that derives from Behavior......
详细查看......
http://www.nikhilk.net/BouncingPlane-Behavior.aspx
相关文章推荐
- 用Balder开源3D引擎实现Silverlight客户端的3D 地图效果(一)
- Silverlight behavior 实现将字符串全部转化为小写的behavior
- 使用Silverlight 3实现3D三维立体图像
- 用Balder开源3D引擎实现Silverlight客户端的3D 地图效果
- 用Balder开源3D引擎实现Silverlight客户端的3D 地图效果(一)
- 【转】Silverlight用代码实现对任意控件向4个方向进行3D旋转
- Silverlight实用窍门系列:60.Silverlight中自定义Behavior,实现图片动画渐变Behavior
- SilverLight用代码实现对任意控件向4个方向进行3D旋转的类
- Silverlight behavior 实现水印效果
- Silverlight实用窍门系列:60.Silverlight中自定义Behavior,实现图片动画渐变Behavior
- Swift 3D 与 Microsoft Silverlight 实现集成
- 纯CSS3实现3D跳动小球
- silverlight 3D 简单特效的实现。
- 使用Silverlight 3实现3D三维立体图像
- 手把手教你使用Silverlight实现3D场景一(素材准备,使用Blend创建主场景)
- Silverlight开发历程—3DEffects实现3D特效
- silverlight 拖动实现-MouseDragElementBehavior
- 手把手教你使用Silverlight实现3D场景二(创建自定义模版控件为物件应用3D动画)
- Silverlight开发历程—3DEffects实现3D特效
- Silverlight开发历程—3DEffects实现3D特效