WidthMinusMarginConverter.cs 852 字节
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace SmartScan.SetControl.WPF.Convent
{
    public class WidthMinusMarginConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is double width)
            {
                // 根据需要调整这个值,减去滚动条宽度、边距等
                return width - 30; // 30是一个估计值,调整为你需要的边距
            }
            return value;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}