mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-11 12:10:48 +08:00
18 lines
525 B
C#
18 lines
525 B
C#
using System;
|
|
using System.Globalization;
|
|
using Irihi.Avalonia.Shared.Converters;
|
|
|
|
namespace Semi.Avalonia.Converters;
|
|
|
|
public class PositionToAngleConverter : MarkupValueConverter
|
|
{
|
|
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return value is double d ? d * 3.6 : 0;
|
|
}
|
|
|
|
public override object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
return value is double d ? d / 3.6 : 0;
|
|
}
|
|
} |