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

TheGreenProgressBar.cs 1.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 TheGreenProgressBar :ProgressBar, IExecutable, IDisposable
  20. {
  21. public event EventHandler PropertyChange; //声明一个事件
  22. public TheGreenProgressBar()
  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(WidthProperty,100d);
  28. SetCurrentValue(HeightProperty,100d);
  29. SetCurrentValue(ValueProperty,50d);
  30. }
  31. static TheGreenProgressBar()
  32. {
  33. DefaultStyleKeyProperty.OverrideMetadata(typeof(TheGreenProgressBar),new FrameworkPropertyMetadata(typeof(TheGreenProgressBar)));
  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. Register();
  46. Style = null;
  47. }
  48. }
  49. }
  50. public void Register()
  51. {
  52. }
  53. public void Dispose()
  54. {
  55. }
  56. }
  57. }