19 lines
582 B
C#
19 lines
582 B
C#
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace Livia.Views.Converters;
|
|
|
|
[ValueConversion(typeof(bool), typeof(string))]
|
|
public class UnfoldButtonStateToStringConverter : IValueConverter
|
|
{
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return Application.Current.TryFindResource($"UnfoldButtonState{value}");
|
|
}
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
} |