60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
using System.Windows.Controls;
|
|
|
|
namespace WPFluent.Controls
|
|
{
|
|
public class TextBoxEx : WPFluent.Controls.TextBox
|
|
{
|
|
public static readonly DependencyProperty HeaderPlacementProperty =
|
|
DependencyProperty.Register(
|
|
nameof(HeaderPlacement),
|
|
typeof(Dock),
|
|
typeof(TextBoxEx),
|
|
new PropertyMetadata(Dock.Top));
|
|
|
|
public static readonly DependencyProperty HeaderProperty =
|
|
DependencyProperty.Register(nameof(Header), typeof(string), typeof(TextBoxEx), new PropertyMetadata(null));
|
|
|
|
// Using a DependencyProperty as the backing store for Prefix. This enables animation, styling, binding, etc...
|
|
public static readonly DependencyProperty PrefixProperty =
|
|
DependencyProperty.Register(nameof(Prefix), typeof(string), typeof(TextBoxEx), new PropertyMetadata(null));
|
|
|
|
// Using a DependencyProperty as the backing store for Suffix. This enables animation, styling, binding, etc...
|
|
public static readonly DependencyProperty SuffixProperty =
|
|
DependencyProperty.Register(nameof(Suffix), typeof(string), typeof(TextBoxEx), new PropertyMetadata(null));
|
|
|
|
static TextBoxEx()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(
|
|
typeof(TextBoxEx),
|
|
new FrameworkPropertyMetadata(typeof(TextBoxEx)));
|
|
}
|
|
|
|
|
|
public string Header
|
|
{
|
|
get { return (string)GetValue(HeaderProperty); }
|
|
set { SetValue(HeaderProperty, value); }
|
|
}
|
|
|
|
|
|
public Dock HeaderPlacement
|
|
{
|
|
get { return (Dock)GetValue(HeaderPlacementProperty); }
|
|
set { SetValue(HeaderPlacementProperty, value); }
|
|
}
|
|
|
|
public string Prefix
|
|
{
|
|
get { return (string)GetValue(PrefixProperty); }
|
|
set { SetValue(PrefixProperty, value); }
|
|
}
|
|
|
|
|
|
public string Suffix
|
|
{
|
|
get { return (string)GetValue(SuffixProperty); }
|
|
set { SetValue(SuffixProperty, value); }
|
|
}
|
|
}
|
|
}
|