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