Files
GeekDesk/Converts/OpcityConvert.cs

25 lines
688 B
C#
Raw Normal View History

2021-04-12 13:46:05 +08:00
using System;
2021-05-28 18:01:19 +08:00
using System.Collections.Generic;
2021-04-12 13:46:05 +08:00
using System.Globalization;
2021-05-28 18:01:19 +08:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2021-04-12 13:46:05 +08:00
using System.Windows.Data;
2021-05-28 18:01:19 +08:00
namespace GeekDesk.Converts
2021-04-12 13:46:05 +08:00
{
2021-05-28 18:01:19 +08:00
public class OpcityConvert : IValueConverter
2021-04-12 13:46:05 +08:00
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
2021-05-28 18:01:19 +08:00
double val = double.Parse(value.ToString());
return (double)(Math.Round((decimal)(val / 100.00), 2));
2021-04-12 13:46:05 +08:00
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}