19 lines
No EOL
570 B
C#
19 lines
No EOL
570 B
C#
using System;
|
|
using System.Globalization;
|
|
using Avalonia.Data.Converters;
|
|
|
|
namespace LANCommander.Launcher.Converters;
|
|
|
|
public class MultiplyConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is double d && double.TryParse(parameter?.ToString(), out var factor))
|
|
return d * factor;
|
|
|
|
return value;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> throw new NotSupportedException();
|
|
} |