Controls: Rewrite UnitTextBox as extension of TextBox instead of UserControl

This commit is contained in:
2024-04-28 20:07:09 +02:00
parent 21fe5bc094
commit c4d68d11bc
16 changed files with 150 additions and 123 deletions

View File

@ -0,0 +1,17 @@
using System.Windows;
using System.Windows.Controls;
namespace Elwig.Controls {
public class UnitTextBox : TextBox {
public static readonly DependencyProperty UnitProperty = DependencyProperty.Register("Unit", typeof(string), typeof(UnitTextBox), new FrameworkPropertyMetadata(""));
public string Unit {
get => (string)GetValue(UnitProperty);
set => SetValue(UnitProperty, value);
}
static UnitTextBox() {
DefaultStyleKeyProperty.OverrideMetadata(typeof(UnitTextBox), new FrameworkPropertyMetadata(typeof(UnitTextBox)));
}
}
}