终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

90 行
2.6 KiB

  1. using BPASmartClient.Compiler;
  2. using BPASmartClient.SCADAControl.Windows;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace BPASmartClient.SCADAControl.CustomerControls
  19. {
  20. /// <summary>
  21. /// ThePopMessage.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class ThePopMessage : UserControl, IExecutable
  24. {
  25. public event EventHandler PropertyChange; //声明一个事件
  26. public string ControlType => "控件";
  27. private bool isExecuteState;
  28. public bool IsExecuteState
  29. {
  30. get { return isExecuteState; }
  31. set
  32. {
  33. isExecuteState = value;
  34. if (IsExecuteState)
  35. {
  36. Register();
  37. }
  38. }
  39. }
  40. public ThePopMessage()
  41. {
  42. InitializeComponent();
  43. Width = 40;
  44. Height = 40;
  45. }
  46. public void Register()
  47. {
  48. }
  49. #region 弹窗属性
  50. [Category("消息类型")]
  51. public EnumPromptType MessageLX
  52. {
  53. get { return (EnumPromptType)GetValue(MessageLXProperty); }
  54. set { SetValue(MessageLXProperty, value); }
  55. }
  56. public static readonly DependencyProperty MessageLXProperty =
  57. DependencyProperty.Register("MessageLX", typeof(EnumPromptType), typeof(ThePopMessage), new PropertyMetadata(EnumPromptType.Info));
  58. [Category("消息数据")]
  59. public string Message
  60. {
  61. get { return (string)GetValue(MessageProperty); }
  62. set
  63. {
  64. SetValue(MessageProperty, value);
  65. MessageDataRefresh();
  66. }
  67. }
  68. public static readonly DependencyProperty MessageProperty =
  69. DependencyProperty.Register("Message", typeof(string), typeof(ThePopMessage), new PropertyMetadata(string.Empty));
  70. public void MessageDataRefresh()
  71. {
  72. try
  73. {
  74. if (!string.IsNullOrEmpty(Message))
  75. {
  76. NoticeDemoViewModel.OpenMsg(MessageLX, Window.GetWindow(this), "通知", Message);
  77. }
  78. }
  79. catch (Exception ex)
  80. {
  81. }
  82. }
  83. #endregion
  84. }
  85. }