This is a mirror of official site: http://jasper-net.blogspot.com/

92. Animated Note Control Using Triggers In Silverlight

| Monday, November 1, 2010
silverlight-note-pad.png?w=407&h=194

   In this entry, I am going to create a simple note control. Let’s look at the initial code I have written below. The idea is that the control should be very simple and easy to create. Create a class and name it say…SlideNoteControl and then refer this control to your Mainpage.xaml where controls: is the namespace of the project.

You can see the live example here [live demo]

The SOURCE CODE(.zip) is at the end of the page for download.

SlideNoteControl.cs

   public class SlideNoteControl : ContentControl
   {
       public SlideNoteControl()
           : base()
       {
           this.DefaultStyleKey = typeof(SlideNoteControl);
       }

       public static readonly DependencyProperty NoteProperty = DependencyProperty
           .Register(“Note”, typeof(UIElement), typeof(SlideNoteControl), null);

       public UIElement Note
       {
           get { return (UIElement)this.GetValue(SlideNoteControl.NoteProperty); }
           set { this.SetValue(SlideNoteControl.NoteProperty, value); }
       }
   }

and here is how you use it in .xaml

silverlight-blog-control.png?w=319&h=89

Read more: Sharker Khaleed Mahmud Silverlight Tips & Tricks

Posted via email from .NET Info

0 comments: