.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> Silverlight >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Create Triggers in Silverlight

Posted By:Mahadesh Mahalingappa       Posted Date: August 11, 2011    Points: 200    Category: Silverlight    URL: http://www.dotnetspark.com  

In this article we are going to look at how we can create Triggers in Silverlight and what do they offer for us .
 

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 .

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3062

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 .


        

    


Output :

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 .

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend