|
|
|
|
|
Home
»
Silverlight
»
Creating and using Storyboards in Blend+Silverlight - Part I
|
Creating and using Storyboards in Blend+Silverlight - Part I
By
Mamta M January 07, 2009
In the first part of this article series, you will explore how to create storyboards and use them to create simple animations.
|
Author Rank:
 |
|
Technologies:
.NET 3.0 and 3.5, Expression Design,Visual C# .NET |
|
Total downloads : |
27 |
|
Total page views : |
1593 |
|
Rating : |
|
0/5 |
|
This article has been rated : |
0 times |
|
|
|
|
Download
Files:
|
|
|
|
|
|
|
|
|
|
|
Similar ArticlesMost ReadTop RatedLatest
|
|
Related EbooksTop Videos
|
|
|
Description
|
|
Author Jeff Scanlon assumes you’re already comfortable with the basics of .NET coding and with WPF, and they help you build on your existing knowledge to make your journey to Silverlight 2 proficiency as quick and painless as possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
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 proficient in C#, ASP.NET and related technologies. In the past few months she has been actively working with Silverlight and is also co-writing a book on Silverlight.
|
|
|
|
|
|
|
|
|
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.
|
Boost the performance of your .NET applications
“ANTS Profiler took us straight to the specific areas of our code which were the cause of our performance issues." Terry Phillips, Sr. Developer, Harley-Davidson Dealer Systems. Download your free trial of ANTS Profiler.
|
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
|
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today. With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications. Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
|
|
|
|
|
|
|
|
|
Download
Files:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|