Reader small image

You're reading from  Instant Silverlight 5 Animation

Product typeBook
Published inJan 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781849687140
Edition1st Edition
Languages
Right arrow
Author (1)
Nick Polyak
Nick Polyak
author image
Nick Polyak

Nick Polyak is a technology enthusiast who enjoys building software and learning new technologies. For the past six years, Nick worked primarily on Silverlight/WPF projects, and prior to that he worked with C++ and Java. Nick is looking forward to harnessing the new capabilities coming with HTML5 and modern JavaScript libraries. Nick got his Ph.D. from Rensselaer Polytechnic Institute in 1998. He did his research in Wavelet based image processing and published a number of papers on the subject. More recently Nick published several articles on codeproject.com some of which (a Prism tutorial and an article on MVVM) became quite popular. Nick is the owner of the AWebPros.com consulting company.
Read more about Nick Polyak

Right arrow

Spinning control sample


We will start developing a simple control sample and gradually expand it to demonstrate all the required concepts.

The resulting sample application is located under CODE\SpinningControlSample\SpinningControlSample.sln, but we recommend that you build this sample from scratch, based on the instructions within this chapter.

The goal of this sample is to develop a lookless control that has a RotationAngle dependency property and later to provide a view for this control (for example, as a rectangle), and to animate the RotationAngle so that the rectangle would be seen as rotating.

Lookless controls are controls that do not contain any visual implementation details. Such controls need a ControlTemplate in order to display them. This provides a great advantage to developers/designers because it separates the control's implementation details from its presentation.

Firstly, let's create a Silverlight Application project called SpinningControlSample. Follow the instructions in Appendix A, Creating and Starting a Silverlight Project, to create a browser-based, empty Silverlight solution. As mentioned in Appendix A, the solution will actually contain two projects, SpinningControlSample and SpinningControlSample.Web. The project with the .Web extension is just an ASP project to embed the Silverlight page. We are not going to concentrate on it. The real project of interest to us is SpinningControlSample.

Within the SpinningControlSample project, we create a new empty C# class, SpinningControl.

Make the SpinningControl class inherit from the Control class as shown in the following code snippet:

public class SpinningControl : Control
{

}

We are going to populate this class to provide the functionality that is previously described.

Previous PageNext Page
You have been reading a chapter from
Instant Silverlight 5 Animation
Published in: Jan 2013Publisher: PacktISBN-13: 9781849687140
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Nick Polyak

Nick Polyak is a technology enthusiast who enjoys building software and learning new technologies. For the past six years, Nick worked primarily on Silverlight/WPF projects, and prior to that he worked with C++ and Java. Nick is looking forward to harnessing the new capabilities coming with HTML5 and modern JavaScript libraries. Nick got his Ph.D. from Rensselaer Polytechnic Institute in 1998. He did his research in Wavelet based image processing and published a number of papers on the subject. More recently Nick published several articles on codeproject.com some of which (a Prism tutorial and an article on MVVM) became quite popular. Nick is the owner of the AWebPros.com consulting company.
Read more about Nick Polyak