Newer
Older
Qwilight / Qwilight / Modifier / MultiplyModifier.cs
@Taehui Taehui on 9 Aug 602 bytes v1.16.36
using System.Globalization;
using System.Windows.Data;

namespace Qwilight.Modifier
{
    public sealed class MultiplyModifier : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => value switch
        {
            double valueFloat64 => valueFloat64 * (double)parameter,
            int valueInt => valueInt * (double)parameter,
            _ => throw new ArgumentException(value.ToString())
        };

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => null;
    }
}