1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Data;
- using System.Windows.Media;
- namespace CyberX8_Themes.Converters
- {
- public class StringToVisibility1 : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return Visibility.Collapsed;
- switch (value.ToString())
- {
- case "PUFA":
- return Visibility.Hidden;
- case "PUFB":
- return Visibility.Visible;
- default:
- return Visibility.Hidden;
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (!(value is bool))
- return false;
- return !(bool)value;
- }
- }
- }
|