123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Windows;
- using System.Windows.Controls.Primitives;
- using System.Windows.Data;
- namespace EfemDualSimulator.Views
- {
- public class IoButton : ToggleButton
- {
- public static readonly DependencyProperty ONProperty;
- static IoButton()
- {
- ONProperty = DependencyProperty.Register("ON", typeof(bool), typeof(IoButton));
- }
- public bool ON
- {
- get { return (bool)GetValue(ONProperty); }
- set { SetValue(ONProperty, value); }
- }
- }
- public class BoolBackgroundConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- bool? ret = (bool?)value;
- return ret.HasValue && ret.Value ? "LightBlue" : "Transparent";
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|