| 123456789101112131415161718192021222324252627282930313233343536373839 |
- 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<int> && parameter != null)
- {
- TradeTreeMenu itemMenu;
- if (Enum.TryParse(parameter.ToString(), out itemMenu))
- {
- int power = (int)itemMenu;
- if ((value as List<int>).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;
- }
- }
- }
|