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; using TeamAAS_VP.Enums; namespace TeamAAS_VP.ValueConverter { public class RobotBrandToVisibiltyConverter : IValueConverter { public bool Inverse { get; set; } = false; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null && value is RobotBrand robotBrand) { if (robotBrand== RobotBrand.XYZ_Platform || robotBrand== RobotBrand.XYZU_Platform || robotBrand == RobotBrand.XYZUR_Platform || robotBrand == RobotBrand.XYZURWV_Platform) { return Inverse ? Visibility.Visible : Visibility.Collapsed; } return Inverse ? Visibility.Collapsed : Visibility.Visible; } else { return Visibility.Collapsed; } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return Binding.DoNothing; } } }