using BPASmartClient.Model.大炒; 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 BPASmartClient.MorkBF.Convert { public class StirToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Visibility visibility = Visibility.Visible; if (value != null && value is FryAction fryAction) { switch (fryAction) { case FryAction.冷锅加热: visibility = Visibility.Collapsed; break; case FryAction.热油: visibility = Visibility.Visible; break; case FryAction.机器人加调料: visibility = Visibility.Collapsed; break; case FryAction.通道出调料: visibility = Visibility.Collapsed; break; case FryAction.炒制菜品: visibility = Visibility.Visible; break; default: break; } } return visibility; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } public class FirePositionToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Visibility visibility = Visibility.Visible; if (value != null && value is FryAction fryAction) { switch (fryAction) { case FryAction.冷锅加热: visibility = Visibility.Visible; break; case FryAction.热油: visibility = Visibility.Visible; break; case FryAction.机器人加调料: visibility = Visibility.Collapsed; break; case FryAction.通道出调料: visibility = Visibility.Collapsed; break; case FryAction.炒制菜品: visibility = Visibility.Visible; break; default: break; } } return visibility; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } public class AccessoriesToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Visibility visibility = Visibility.Visible; if (value != null && value is FryAction fryAction) { switch (fryAction) { case FryAction.冷锅加热: visibility = Visibility.Collapsed; break; case FryAction.热油: visibility = Visibility.Collapsed; break; case FryAction.机器人加调料: visibility = Visibility.Visible; break; case FryAction.通道出调料: visibility = Visibility.Visible; break; case FryAction.炒制菜品: visibility = Visibility.Visible; break; default: break; } } return visibility; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }