using System.Windows;
public class CustomTextBox : System.Windows.Controls.TextBox
{
public static readonly DependencyProperty CustomStringProperty = DependencyProperty.Register
(
"CustomString",
typeof(bool),
typeof(CustomTextBox),
null
);
public string CustomString
{
get { return (string)GetValue(CustomStringProperty); }
set { SetValue(CustomStringProperty, value); }
}
}
You can now use the CustomTextBox in your XAML, and bind directly to the CustomString property.
Just a simple example to illustrate how its done. If you want more information on how it all works, check out the MSDN documentation.
No comments:
Post a Comment