Files
Semi.Avalonia/src/Semi.Avalonia/Converters/PositionToAngleConverter.cs

18 lines
525 B
C#
Raw Normal View History

2023-07-03 11:49:11 +08:00
using System;
using System.Globalization;
using Irihi.Avalonia.Shared.Converters;
2023-07-03 11:49:11 +08:00
namespace Semi.Avalonia.Converters;
public class PositionToAngleConverter : MarkupValueConverter
2023-07-03 11:49:11 +08:00
{
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
2023-07-03 11:49:11 +08:00
{
return value is double d ? d * 3.6 : 0;
2023-07-03 11:49:11 +08:00
}
public override object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
2023-07-03 11:49:11 +08:00
{
return value is double d ? d / 3.6 : 0;
2023-07-03 11:49:11 +08:00
}
}