Controls: Add UnitTextBox

This commit is contained in:
2023-11-04 21:59:59 +01:00
parent 12226c3d0f
commit 6435a649b4
12 changed files with 118 additions and 57 deletions
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;
namespace Elwig.Controls {
public class WidthToPaddingConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
return new Thickness(2, 2, 4 + (double)value, 2);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
return ((Thickness)value).Right - 4;
}
}
}