O'Reilly logo

Instant Silverlight 5 Animation by Nick Polyak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. Using snippets

Here we give an example of snippet usage by showing how to create a dependency property within C# code using propdp snippet. (Creating dependency and attached properties in code would be a pain without snippets).

We are going to create a dependency property RotationAngle of type double within the SpinningControl class.

Within that RotationAngle.cs file, move the cursor to the place you want the dependency property to be at and type propdp<tab>.

The snippet will expand into the following text:

 #region MyProperty Dependency Property public int MyProperty { get { return (int)GetValue(MyPropertyProperty); } set { SetValue(MyPropertyProperty, value); } } public static readonly DependencyProperty MyPropertyProperty = DependencyProperty.Register ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required