终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

65 line
1.7 KiB

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