终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

48 rindas
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. /// YellowLight.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class YellowLight : UserControl
  21. {
  22. public YellowLight()
  23. {
  24. InitializeComponent();
  25. }
  26. private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  27. {
  28. (d as YellowLight)?.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(YellowLight),
  41. new PropertyMetadata(false, new PropertyChangedCallback(OnPropertyChanged)));
  42. }
  43. }