using System; using System.Globalization; using System.Windows; using System.Windows.Data; using XP.ImageProcessing.RoiControl.Models; namespace XP.ImageProcessing.RoiControl.Converters { public class ROITypeToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is ROIType roiType && parameter is string targetTypeName) { bool match = roiType.ToString() == targetTypeName; return match ? Visibility.Visible : Visibility.Collapsed; } return Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }