| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using Panuon.UI.Silver;
- using System;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- namespace SHJX.Service.Librarys.manual
- {
- /// <summary>
- /// LiquidOperate.xaml 的交互逻辑
- /// </summary>
- public partial class LiquidOperate : UserControl
- {
- public string OpName
- {
- set => head.Header = value;
- }
- public Visibility PumpInVisibility
- {
- set => PumpIn.Visibility = value;
- }
- public Visibility PumpOutVisibility
- {
- set => PumpOut.Visibility = value;
- }
- public bool OutLiquidWaiting
- {
- get => (bool)GetValue(OutLiquidWaitingProperty);
- set => SetValue(OutLiquidWaitingProperty, value);
- }
- public static readonly DependencyProperty OutLiquidWaitingProperty =
- DependencyProperty.Register(
- nameof(OutLiquidWaiting), typeof(bool),
- typeof(LiquidOperate), new UIPropertyMetadata(false, OutLiquidWaitingChangedCallback));
- private static void OutLiquidWaitingChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
- {
- var control = obj as LiquidOperate;
- var path = control?.PumpOut;
- Binding binding = new Binding
- {
- Source = Convert.ToBoolean(args.NewValue)
- };
- BindingOperations.SetBinding(path, ButtonHelper.IsWaitingProperty, binding);
- }
- public bool InLiquidWaiting
- {
- get => (bool)GetValue(InLiquidWaitingProperty);
- set => SetValue(InLiquidWaitingProperty, value);
- }
- public static readonly DependencyProperty InLiquidWaitingProperty =
- DependencyProperty.Register(
- nameof(InLiquidWaiting), typeof(bool),
- typeof(LiquidOperate), new UIPropertyMetadata(false, InLiquidWaitingChangedCallback));
- private static void InLiquidWaitingChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
- {
- var control = obj as LiquidOperate;
- var path = control?.PumpIn;
- Binding binding = new()
- {
- Source = Convert.ToBoolean(args.NewValue)
- };
- BindingOperations.SetBinding(path, ButtonHelper.IsWaitingProperty, binding);
- }
- public LiquidOperate()
- {
- InitializeComponent();
- }
- }
- }
|