终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

50 行
1.3 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace BPASmartClient.CustomResource.UserControls
  16. {
  17. /// <summary>
  18. /// GreenLight.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class GreenLight : UserControl
  21. {
  22. public GreenLight()
  23. {
  24. InitializeComponent();
  25. }
  26. private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  27. {
  28. (d as GreenLight)?.Refresh();
  29. }
  30. private void Refresh()
  31. {
  32. this.on.Visibility = IsRun ? Visibility.Visible : Visibility.Collapsed;
  33. }
  34. public bool IsRun
  35. {
  36. get { return (bool)GetValue(IsRunProperty); }
  37. set { SetValue(IsRunProperty, value); }
  38. }
  39. public static readonly DependencyProperty IsRunProperty =
  40. DependencyProperty.Register("IsRun", typeof(bool), typeof(GreenLight),
  41. new PropertyMetadata(false, new PropertyChangedCallback(OnPropertyChanged)));
  42. }
  43. }