|
|
|
|
|
Home
»
Silverlight
»
Creating and using Storyboards in Blend+Silverlight - Part I
|
|
|
|
Author Rank :
|
|
|
Page Views :
|
9646
|
|
Downloads :
|
106
|
|
Rating :
|
Rate it
|
|
Level :
|
Beginner
|
|
|
|
|
Download
Files:
|
|
|
|
|
|
|
|
|
|
|
|
Introduction:
A storyboard in a Blend or Silverlight application is a resource that contains a collection of animations each of which targets a specific property of a specific control. Animations here mean actions that temporarily change the property values of elements. For example, a rendering action of a button as skewed is an animation action.
Storyboards are created in the Blend IDE using the Storyboard picker.
Assume that you have created a Silverlight 2 application in Blend. Add a Button control to it.
Then, launch the Storyboard Picker by clicking the + symbol and selecting the New option. Figure 1 shows the New option.

Figure 1
In the Create Storyboard Resource dialog box, leave the default name as is.

Figure 2
Open the newly created Storyboard by using the dropdown option in the Object and Timeline section.

Figure 3
Select the Properties pane for the Button and after scrolling to the Transform property group, choose Skew option and skew the button. Figure 4 shows this setting in action.

Figure 4
Click Base to stop recording.
Similarly, create another Storyboard, Storyboard2, and within it, skew the button in the opposite direction.
Then, in the Properties Pane for the button, click the lightning bolt symbol to open the Events pane.
Add an event for Button_Click. If you are using Visual Studio 2008 Express Edition or Visual Web Developer Express Edition then you will have to manually copy the event handler to the Page.xaml.cs file. Otherwise, in other editions such as Professional edition, the event handler is automatically added to the Page.xaml.cs file.
Within the event handler, in the Page.xaml.cs file, add the following code (marked bold for your reference):
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { Storyboard myStoryboard; myStoryboard = (Storyboard)this.Resources["Storyboard1"]; myStoryboard.Begin(); myStoryboard = (Storyboard)this.Resources["Storyboard2"]; myStoryboard.Begin(); }
Save, build and test the application. Click the button on the browser output and see the animation action.
Conclusion: Thus, in the first part of this article series, you explored how to create storyboards and use them to create simple animations.
|
|
Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post
Here.
|
|
|
|
|
Login
to add your contents and source code to this article
|
|
|
|
|
|
|
|
|
|
|
|
Mamta M
Mamta M has over 8 years of experience in the IT industry and loves to learn and experiment with new technology trends. She is passionate about in C#, WPF, ASP.NET, Silverlight and other .NET related technologies. She believes knowledge grows through sharing and loves being active in the .NET community.
|
|
|
|
|
|
|
|
|
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional
consulting company, our consultants are well-known experts in .NET and many of them
are MVPs, authors, and trainers. We specialize in Microsoft .NET development and
utilize Agile Development and Extreme Programming practices to provide fast pace
quick turnaround results. Our software development model is a mix of Agile Development,
traditional SDLC, and Waterfall models.
|
|
Click here to learn more about C# Consulting. |
|
|
|
|
|
|
|
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon.
Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees.
As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
|
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
|
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
|
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
|
|
|
|
|
|
|
|
|
|
|
|
|