mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
24 lines
642 B
C#
24 lines
642 B
C#
using System.Globalization;
|
|
using Avalonia.Data.Converters;
|
|
|
|
namespace Splitter_UI.Converters;
|
|
|
|
public sealed class ActionToIconConverter : IValueConverter
|
|
{
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
if (value == null)
|
|
return null;
|
|
|
|
var p = System.Convert.ToInt32(value);
|
|
|
|
return p == 0
|
|
? "\uf125" // FA7 crop
|
|
: "\uf2f1" // FA7 rotate
|
|
;
|
|
}
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> throw new NotSupportedException();
|
|
}
|