Files
ShrlAlgoToolkit/Wpf.Ui.Extend/Controls/TextBoxEx/TextBoxEx.xaml.cs
2024-09-22 11:05:41 +08:00

58 lines
2.0 KiB
C#

using System.Windows;
using System.Windows.Controls;
namespace Wpf.Ui.Extend.Controls
{
public class TextBoxEx : Wpf.Ui.Controls.TextBox
{
static TextBoxEx()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBoxEx), new FrameworkPropertyMetadata(typeof(TextBoxEx)));
}
public string Prefix
{
get { return (string)GetValue(PrefixProperty); }
set { SetValue(PrefixProperty, value); }
}
// 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));
public string Suffix
{
get { return (string)GetValue(SuffixProperty); }
set { SetValue(SuffixProperty, value); }
}
// 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));
public string Header
{
get { return (string)GetValue(HeaderProperty); }
set { SetValue(HeaderProperty, value); }
}
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register(nameof(Header), typeof(string), typeof(TextBoxEx), new PropertyMetadata(null));
public Dock HeaderPlacement
{
get { return (Dock)GetValue(HeaderPlacementProperty); }
set { SetValue(HeaderPlacementProperty, value); }
}
public static readonly DependencyProperty HeaderPlacementProperty =
DependencyProperty.Register(nameof(HeaderPlacement), typeof(Dock), typeof(TextBoxEx), new PropertyMetadata(Dock.Top));
}
}