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.
93 lines
3.3 KiB
93 lines
3.3 KiB
using System;
|
|
using System.Windows.Controls;
|
|
using System.Windows;
|
|
using System.Globalization;
|
|
|
|
namespace Microsoft.Windows.Controls.Primitives
|
|
{
|
|
public abstract class InputBase : Control
|
|
{
|
|
#region Properties
|
|
|
|
#region CultureInfo
|
|
|
|
public static readonly DependencyProperty CultureInfoProperty = DependencyProperty.Register("CultureInfo", typeof(CultureInfo), typeof(InputBase), new UIPropertyMetadata(CultureInfo.CurrentCulture));
|
|
public CultureInfo CultureInfo
|
|
{
|
|
get { return (CultureInfo)GetValue(CultureInfoProperty); }
|
|
set { SetValue(CultureInfoProperty, value); }
|
|
}
|
|
|
|
#endregion //CultureInfo
|
|
|
|
#region IsEditable
|
|
|
|
public static readonly DependencyProperty IsEditableProperty = DependencyProperty.Register("IsEditable", typeof(bool), typeof(InputBase), new PropertyMetadata(true));
|
|
public bool IsEditable
|
|
{
|
|
get { return (bool)GetValue(IsEditableProperty); }
|
|
set { SetValue(IsEditableProperty, value); }
|
|
}
|
|
|
|
#endregion //IsEditable
|
|
|
|
#region Text
|
|
|
|
public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(InputBase), new UIPropertyMetadata(default(String), OnTextChanged));
|
|
public string Text
|
|
{
|
|
get { return (string)GetValue(TextProperty); }
|
|
set { SetValue(TextProperty, value); }
|
|
}
|
|
|
|
private static void OnTextChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
InputBase inputBase = o as InputBase;
|
|
if (inputBase != null)
|
|
inputBase.OnTextChanged((string)e.OldValue, (string)e.NewValue);
|
|
}
|
|
|
|
protected virtual void OnTextChanged(string oldValue, string newValue)
|
|
{
|
|
|
|
}
|
|
|
|
#endregion //Text
|
|
|
|
#region TextAlignment
|
|
|
|
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register("TextAlignment", typeof(TextAlignment), typeof(InputBase), new UIPropertyMetadata(TextAlignment.Left));
|
|
public TextAlignment TextAlignment
|
|
{
|
|
get { return (TextAlignment)GetValue(TextAlignmentProperty); }
|
|
set { SetValue(TextAlignmentProperty, value); }
|
|
}
|
|
|
|
|
|
#endregion //TextAlignment
|
|
|
|
#region Watermark
|
|
|
|
public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register("Watermark", typeof(object), typeof(InputBase), 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(InputBase), new UIPropertyMetadata(null));
|
|
public DataTemplate WatermarkTemplate
|
|
{
|
|
get { return (DataTemplate)GetValue(WatermarkTemplateProperty); }
|
|
set { SetValue(WatermarkTemplateProperty, value); }
|
|
}
|
|
|
|
#endregion //WatermarkTemplate
|
|
|
|
#endregion //Properties
|
|
}
|
|
}
|
|
|