GameData and Converter Changes (#6)

This commit is contained in:
Brett Hewitson 2021-08-20 11:27:12 +10:00 committed by GitHub
parent b63ceae2aa
commit 671096a758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 5 deletions

View file

@ -0,0 +1,21 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace ServerManagerTool.Common.Converters
{
public class InvertIntToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double scaledValue = System.Convert.ToInt32(value);
return scaledValue == 0 ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException("InvertIntToVisibilityConverter is a OneWay converter.");
}
}
}