终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

TheTextBox.cs 1.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 BPASmartClient.SCADAControl.CustomerControls
  18. {
  19. public class TheTextBox : TextBox, IExecutable
  20. {
  21. static TheTextBox()
  22. {
  23. DefaultStyleKeyProperty.OverrideMetadata(typeof(TheTextBox), new FrameworkPropertyMetadata(typeof(TheTextBox)));
  24. }
  25. public TheTextBox()
  26. {
  27. Text = "0.01";
  28. VerticalContentAlignment = VerticalAlignment.Center;
  29. Style = Application.Current.Resources["DesignTheTextBox"] as Style;//FindResource("DesignTheTextBox") as Style;
  30. Focusable = false;
  31. }
  32. public string ControlType => "控件";
  33. private bool isExecuteState;
  34. public bool IsExecuteState
  35. {
  36. get { return isExecuteState; }
  37. set
  38. {
  39. isExecuteState = value;
  40. if (IsExecuteState)
  41. {
  42. IsEnabled = true;
  43. Focusable = true;
  44. Register();
  45. Style = null;
  46. }
  47. }
  48. }
  49. public void Register()
  50. {
  51. }
  52. }
  53. }