Files
XplorePlane/XP.ImageProcessing.RoiControl/ROITypeToVisibilityConverter.cs
T
2026-04-13 14:36:18 +08:00

26 lines
850 B
C#

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();
}
}
}