feat: add hero stats panel
This commit is contained in:
26
Client/Application/Converters/PercentWidthConverter.cs
Normal file
26
Client/Application/Converters/PercentWidthConverter.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Client.Application.Converters
|
||||
{
|
||||
public class PercentWidthConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (!(values[0] is double))
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
return ((double)values[0] / 100 * (Double)values[1]);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user