Added WPF tester
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace EonaCat.VolumeMixer.Tester.WPF.Converter
|
||||
{
|
||||
public class VolumeToPercentageConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is float volume)
|
||||
{
|
||||
return $"{Math.Round(volume * 100)}%";
|
||||
}
|
||||
return "0%";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user