2023-11-13 11:52:43 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
|
|
|
|
namespace DM_Weight.Converter
|
|
|
|
|
{
|
|
|
|
|
internal class DrawerSelectConverter : IMultiValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
2024-08-07 09:45:18 +08:00
|
|
|
|
int iLength = value[0].ToString().Length;
|
|
|
|
|
int ButtonDrawerNo = int.Parse(value[0].ToString().Substring(0, iLength-3));
|
2023-11-13 11:52:43 +08:00
|
|
|
|
int SelectedDrawerNo = int.Parse(value[1].ToString());
|
|
|
|
|
return ButtonDrawerNo == SelectedDrawerNo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|