22 lines
518 B
C#
22 lines
518 B
C#
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();
|
|
}
|
|
} |