日期:2014-05-20 浏览次数:21310 次
public class TextBoxEx : TextBox
{
static TextBoxEx()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxEx), new FrameworkPropertyMetadata(typeof(TextBoxEx)));
HelpTextProperty = DependencyProperty.Register("HelpText", typeof(string), typeof(TextBoxEx),
new FrameworkPropertyMetadata("请您输入..", new PropertyChangedCallback(OnHelpTextChanged)));
}
public static DependencyProperty HelpTextProperty;
public string HelpText
{
get { return (string)GetValue(HelpTextProperty); }
set { SetValue(HelpTextProperty, value); }
}
private static void OnHelpTextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
}
}