You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
934 B

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows;
using System.Windows.Data;
namespace BBWYB.Client.Converters
{
public class PurchaseOrderDelBtnConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
long.TryParse(values[0]?.ToString(), out long id);
int.TryParse(values[1]?.ToString(), out int purchaseQuantity);
int.TryParse(values[2]?.ToString(), out int remainingQuantity);
return id == 0 || (id != 0 && purchaseQuantity != 0 && purchaseQuantity == remainingQuantity) ? Visibility.Visible : Visibility.Collapsed;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}