1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- using System.Windows.Media;
- namespace CyberX8_Themes.Converters
- {
- public class BoolToRedGreenColor : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return value != null ? ((bool)value ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Lime)) : new SolidColorBrush(Colors.Red);
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- public class BoolToRedGreenColor1 : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return value != null ? ((bool)value ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Lime)) : new SolidColorBrush(Colors.Gray);
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|