26 lines
850 B
C#
26 lines
850 B
C#
using XP.ImageProcessing.RoiControl.Models;
|
|
using System;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |