add TypeConverterWrapper
This commit is contained in:
1 parent
aae27e4142
commit
6109862b37
1 file changed
+16
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace mbts.ui.converters {
|
||||
class TypeConverterWrapper : IValueConverter {
|
||||
public TypeConverter TypeConverter { get; set; }
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
|
||||
TypeConverter.ConvertFrom(null, culture, value);
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) =>
|
||||
TypeConverter.ConvertTo(null, culture, value, targetType);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user