2025-02-10 20:53:40 +08:00
|
|
|
|
using System.Windows.Controls;
|
2024-09-22 11:05:41 +08:00
|
|
|
|
|
2025-02-10 20:53:40 +08:00
|
|
|
|
namespace WPFluent.Controls
|
2024-09-22 11:05:41 +08:00
|
|
|
|
{
|
2025-02-10 20:53:40 +08:00
|
|
|
|
public class TextBoxEx : WPFluent.Controls.TextBox
|
2024-09-22 11:05:41 +08:00
|
|
|
|
{
|
2025-02-10 20:53:40 +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
|
|
|
|
|
2025-02-10 20:53:40 +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));
|
|
|
|
|
|
|
2025-02-10 20:53:40 +08:00
|
|
|
|
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); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-10 20:53:40 +08:00
|
|
|
|
public string Prefix
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (string)GetValue(PrefixProperty); }
|
|
|
|
|
|
set { SetValue(PrefixProperty, value); }
|
|
|
|
|
|
}
|
2024-09-22 11:05:41 +08:00
|
|
|
|
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
|
|
public string Suffix
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (string)GetValue(SuffixProperty); }
|
|
|
|
|
|
set { SetValue(SuffixProperty, value); }
|
|
|
|
|
|
}
|
2024-09-22 11:05:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|