Files
Shrlalgo.RvKits/WPFluent/Controls/TextBoxEx/TextBoxExl.cs

60 lines
2.0 KiB
C#
Raw Normal View History

using System.Windows.Controls;
2024-09-22 11:05:41 +08:00
namespace WPFluent.Controls
2024-09-22 11:05:41 +08:00
{
public class TextBoxEx : WPFluent.Controls.TextBox
2024-09-22 11:05:41 +08:00
{
public static readonly DependencyProperty HeaderPlacementProperty =
DependencyProperty.Register(
nameof(HeaderPlacement),
typeof(Dock),
typeof(TextBoxEx),
new PropertyMetadata(Dock.Top));
2024-09-22 11:05:41 +08:00
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register(nameof(Header), typeof(string), typeof(TextBoxEx), new PropertyMetadata(null));
2024-09-22 11:05:41 +08:00
// 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)));
}
2024-09-22 11:05:41 +08:00
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); }
}
2024-09-22 11:05:41 +08:00
public string Suffix
{
get { return (string)GetValue(SuffixProperty); }
set { SetValue(SuffixProperty, value); }
}
2024-09-22 11:05:41 +08:00
}
}