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
Read more:
Sharker Khaleed Mahmud Silverlight Tips & Tricks Posted via email from .NET Info
0 comments:
Post a Comment