feat: Clip.
This commit is contained in:
22
src/Ursa/Converters/DivideByTwoConverter.cs
Normal file
22
src/Ursa/Converters/DivideByTwoConverter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Ursa.Converters;
|
||||
|
||||
public class DivideByTwoConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is double d)
|
||||
{
|
||||
return d / 2;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user