This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;
using System.Windows;
namespace AntdWpf.Converters
{
public class DoubleToThicknessMultiConverter : MarkupExtension, IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var parent = values[0] as double?;
var self = values[1] as double?;
if (parent == null || self == null)
{
return default(Thickness);
}
double.TryParse(parameter as string, out double param);
return new Thickness(parent.Value - self.Value - param, 0.0, 0.0, 0.0);
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
return targetTypes.Select(t => DependencyProperty.UnsetValue).ToArray();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}