Files
bluflame/intromat/Intromat/Converters/WidthToMarginConverter.cs
2026-04-18 22:31:51 +02:00

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; }
}
}