终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

62 строки
1.6 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. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace BeDesignerSCADA.CustomerControls
  18. {
  19. public class TheTextBox : TextBox, IExecutable
  20. {
  21. public event EventHandler PropertyChange; //声明一个事件
  22. static TheTextBox()
  23. {
  24. DefaultStyleKeyProperty.OverrideMetadata(typeof(TheTextBox), new FrameworkPropertyMetadata(typeof(TheTextBox)));
  25. }
  26. public TheTextBox()
  27. {
  28. Width = 80;
  29. Height = 30;
  30. Text = "0.01";
  31. VerticalContentAlignment = VerticalAlignment.Center;
  32. Style = Application.Current.Resources["DesignTheTextBox"] as Style;//FindResource("DesignTheTextBox") as Style;
  33. Focusable = false;
  34. }
  35. public string ControlType => "控件";
  36. private bool isExecuteState;
  37. public bool IsExecuteState
  38. {
  39. get { return isExecuteState; }
  40. set
  41. {
  42. isExecuteState = value;
  43. if (IsExecuteState)
  44. {
  45. IsEnabled = true;
  46. Focusable = true;
  47. Register();
  48. Style = null;
  49. }
  50. }
  51. }
  52. public void Register()
  53. {
  54. }
  55. }
  56. }