24 lines
663 B
C#
24 lines
663 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace Intromat.Converters
|
|
{
|
|
public class WidthToMarginConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
var width = (double)value;
|
|
return Side ? new Thickness(-width, 0, 0, 0) : new Thickness(0, 0, -width, 0);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool Side { get; set; }
|
|
}
|
|
}
|