using Muchinfo.MTPClient.Data.Enums; using System; using System.Collections.Generic; using System.Windows; using System.Windows.Data; namespace Muchinfo.MTPClient.Account.Utilities { public class PowerConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is List && parameter != null) { TradeTreeMenu itemMenu; if (Enum.TryParse(parameter.ToString(), out itemMenu)) { int power = (int)itemMenu; if ((value as List).Contains(power)) { return Visibility.Visible; } else { return Visibility.Collapsed; } } } return Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return 0; } } }