You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
using System;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Microsoft.Windows.Controls
|
|
{
|
|
public class WatermarkTextBox : TextBox
|
|
{
|
|
#region Properties
|
|
|
|
#region Watermark
|
|
|
|
public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register("Watermark", typeof(object), typeof(WatermarkTextBox), new UIPropertyMetadata(null));
|
|
public object Watermark
|
|
{
|
|
get { return (object)GetValue(WatermarkProperty); }
|
|
set { SetValue(WatermarkProperty, value); }
|
|
}
|
|
|
|
#endregion //Watermark
|
|
|
|
#region WatermarkTemplate
|
|
|
|
public static readonly DependencyProperty WatermarkTemplateProperty = DependencyProperty.Register("WatermarkTemplate", typeof(DataTemplate), typeof(WatermarkTextBox), new UIPropertyMetadata(null));
|
|
public DataTemplate WatermarkTemplate
|
|
{
|
|
get { return (DataTemplate)GetValue(WatermarkTemplateProperty); }
|
|
set { SetValue(WatermarkTemplateProperty, value); }
|
|
}
|
|
|
|
#endregion //WatermarkTemplate
|
|
|
|
#endregion //Properties
|
|
|
|
#region Constructors
|
|
|
|
static WatermarkTextBox()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(WatermarkTextBox), new FrameworkPropertyMetadata(typeof(WatermarkTextBox)));
|
|
}
|
|
|
|
#endregion //Constructors
|
|
}
|
|
}
|
|
|