27 lines
727 B
C#
27 lines
727 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace GeekDesk.Converts
|
|
{
|
|
class DoubleToGridLength : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
double val = double.Parse(value.ToString());
|
|
return new GridLength(val);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
GridLength val = (GridLength)value;
|
|
return double.Parse(val.ToString());
|
|
}
|
|
}
|
|
}
|