mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-17 22:56:37 +08:00
feat: add progress ring.
This commit is contained in:
27
src/Semi.Avalonia/Converters/PositionToAngleConverter.cs
Normal file
27
src/Semi.Avalonia/Converters/PositionToAngleConverter.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
|
||||
public class PositionToAngleConverter: IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return d * 3.6;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return d / 3.6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user