终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

63 righe
1.7 KiB

  1. using BPASmartClient.Compiler;
  2. using BPASmartClient.SCADAControl;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. namespace BeDesignerSCADA.CustomerControls
  11. {
  12. public class DigitalNumber : Control, IExecutable
  13. {
  14. public event EventHandler PropertyChange; //声明一个事件
  15. public DigitalNumber()
  16. {
  17. Width = 80;
  18. Height = 30;
  19. }
  20. public string ControlType => "控件";
  21. static DigitalNumber()
  22. {
  23. DefaultStyleKeyProperty.OverrideMetadata(typeof(DigitalNumber), new FrameworkPropertyMetadata(typeof(DigitalNumber)));
  24. }
  25. TextBlock text = null;
  26. public override void OnApplyTemplate()
  27. {
  28. base.OnApplyTemplate();
  29. text = GetTemplateChild("line") as TextBlock;
  30. }
  31. public double NumberValue
  32. {
  33. get { return (double)GetValue(NumberValueProperty); }
  34. set { SetValue(NumberValueProperty, value); }
  35. }
  36. public static readonly DependencyProperty NumberValueProperty =
  37. DependencyProperty.Register("NumberValue", typeof(double), typeof(DigitalNumber), new UIPropertyMetadata(0.00d));
  38. private bool isExecuteState;
  39. public bool IsExecuteState
  40. {
  41. get { return isExecuteState; }
  42. set
  43. {
  44. isExecuteState = value;
  45. if (IsExecuteState)
  46. {
  47. Register();
  48. }
  49. }
  50. }
  51. public void Register()
  52. {
  53. }
  54. }
  55. }