Creating Triggers in Silverlight :
In this article we are going to look at how we can create Triggers in Silverlight and what do they offer for us .
First Step :
Install Blend 4 SDK from the Microsoft Site .
The Dll we require to implement the triggers is Microsoft.Expression.Interactions.dll .
Please find the screenshot below :
Created a new Silverlight Project and named it as SilverlightTriggers .
Add a reference to the Dll Microsoft.Expression.Interactions.dll .
Lets create a simple trigger to animate the border of the Button .
No code Behind is required . All the work has to be done on the Xaml .
Lets go one step at a time .
Add a Button to the Grid .
Add the namespaces to the Button Tag .
Add the StoryBoard in the Resource Tag of the Button .
Finally Add the Trigger . I have added a Simple Trigger which performs the play operation on the storyboard .
The Button is displayed as shown below :
Click on it and you can see it animate . Well you can animate it differently by changing the storyboard . This is just a illustration . Happy Coding .