Controls: Rewrite UnitTextBox as extension of TextBox instead of UserControl
This commit is contained in:
1 parent
21fe5bc094
commit
c4d68d11bc
16 files changed
+150
-123
No files matched your search
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Elwig.Controls {
|
||||
public class WidthToMarginConverter : IValueConverter {
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return new Thickness(0, 0, 2 + (double)value, 0);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
|
||||
return ((Thickness)value).Right - 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user