livia-test/Livia/Views/Converters/RoiLocationDisplayModeToStringConverter.cs
2025-03-28 14:31:53 +08:00

20 lines
634 B
C#

using System.Globalization;
using System.Windows;
using System.Windows.Data;
using Livia.ViewModels;
namespace Livia.Views.Converters;
[ValueConversion(typeof(RoiLocationDisplayMode), typeof(string))]
public class RoiLocationDisplayModeToStringConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
return Application.Current.TryFindResource($"RoiLocationDisplayMode{value}");
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}