using Muchinfo.MTPClient.Data.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Data; namespace Muchinfo.MTPClient.Infrastructure.Converters { public class RelationModeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Visibility result = Visibility.Collapsed; if (value != null) { switch(value.ToString()) { case "N": result = Visibility.Collapsed; break; default: result = Visibility.Visible; break; } } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } public class RelationPModeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Visibility result = Visibility.Collapsed; if (value != null) { switch ((eDeliveryContractLink)value) { case eDeliveryContractLink.Normal: result = Visibility.Collapsed; break; default: result = Visibility.Visible; break; } } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }