port from perforce
This commit is contained in:
23
intromat/Intromat/Converters/WidthToMarginConverter.cs
Normal file
23
intromat/Intromat/Converters/WidthToMarginConverter.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user