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

73 строки
2.1 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 BPASmartClient.SCADAControl.CustomerControls
  18. {
  19. public class TheRadioButton : RadioButton, IExecutable, IDisposable
  20. {
  21. public event EventHandler PropertyChange; //声明一个事件
  22. public TheRadioButton()
  23. {
  24. ResourceDictionary languageResDic = new ResourceDictionary();
  25. languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute);
  26. this.Resources.MergedDictionaries.Add(languageResDic);
  27. SetCurrentValue(ContentProperty, "单选按钮");
  28. this.Loaded += TheButton_Loaded;
  29. }
  30. private void TheButton_Loaded(object sender, RoutedEventArgs e)
  31. {
  32. if (this.ActualWidth <= 70 && this.Content.ToString() == "单选按钮")
  33. {
  34. Content = "单选按钮";
  35. Width = 78;
  36. Height = 24;
  37. }
  38. }
  39. static TheRadioButton()
  40. {
  41. DefaultStyleKeyProperty.OverrideMetadata(typeof(TheRadioButton), new FrameworkPropertyMetadata(typeof(TheRadioButton)));
  42. }
  43. public string ControlType => "控件";
  44. private bool isExecuteState;
  45. public bool IsExecuteState
  46. {
  47. get { return isExecuteState; }
  48. set
  49. {
  50. isExecuteState = value;
  51. if (IsExecuteState)
  52. {
  53. Register();
  54. //Style = null;
  55. }
  56. }
  57. }
  58. public void Register()
  59. {
  60. }
  61. public void Dispose()
  62. {
  63. }
  64. }
  65. }