Creating custom behaviors

We have seen in other movies how you can download custom behaviors that…other people have built.…In this movie, I will show you how to create your own custom behaviors.…If you are following along with the Exercise Files, you are going to want…to open the CustomBehavior solution and then double click on the…MainPage.xaml file.…In this example, I have several items on my work area and I am going to add a…behavior called the ChangeZIndexBehavior.…I think it will be nice if I could create a behavior, doing to make it very…simple for a designer to move an item to the front without having to write any code.…

To do that, you need to create a class.…I have created a class called ChangeZIndexBehavior.cs.…Let's double click on that file.…And then in Expression Blend, you can press F4 to move the tool panels away.…We start by creating the class and deriving from Behavior.…This is a generic class and you specify which elements you can apply this behavior to.…In my case, it will be any panel type.…When the behavior is attached to an object, it will run this code,…

Resume Transcript Auto-Scroll

Author

Released

3/2/2010

Silverlight 3 and its associated development tools, Expression Blend and Visual Studio, are used to reproduce the look and feel of a desktop application in a browser deployed, cross-platform framework. Silverlight 3 Essential Training is designed to teach programmers how to create dynamic, interactive, rich Internet applications that run on Silverlight 3. Instructor Walt Ritscher covers the basic framework architecture to creating an engaging user interface. This course requires a working knowledge of C#, but includes lessons on XAML, a language designed to make coding in Silverlight easier. Exercise files accompany the course.