27 lines
803 B
C#
27 lines
803 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
|
|
namespace DM_Weight.Converter
|
|
{
|
|
public class InputQuantityConverter : IValueConverter
|
|
{
|
|
public bool ReadOnlyValue { get; set; } = true;
|
|
public bool NotReadOnlyValue { get; set; } = false;
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return int.Parse(value.ToString()) == 2 || int.Parse(value.ToString()) == 6 ? ReadOnlyValue : NotReadOnlyValue;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return Binding.DoNothing;
|
|
}
|
|
}
|
|
}
|