using BPASmartClient.Compiler; using BPASmartClient.SCADAControl.Windows; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace BPASmartClient.SCADAControl.CustomerControls { /// /// ThePopMessage.xaml 的交互逻辑 /// public partial class ThePopMessage : UserControl, IExecutable { public event EventHandler PropertyChange; //声明一个事件 public string ControlType => "控件"; private bool isExecuteState; public bool IsExecuteState { get { return isExecuteState; } set { isExecuteState = value; if (IsExecuteState) { Register(); } } } public ThePopMessage() { InitializeComponent(); Width = 40; Height = 40; } public void Register() { } #region 弹窗属性 [Category("消息类型")] public EnumPromptType MessageLX { get { return (EnumPromptType)GetValue(MessageLXProperty); } set { SetValue(MessageLXProperty, value); } } public static readonly DependencyProperty MessageLXProperty = DependencyProperty.Register("MessageLX", typeof(EnumPromptType), typeof(ThePopMessage), new PropertyMetadata(EnumPromptType.Info)); [Category("消息数据")] public string Message { get { return (string)GetValue(MessageProperty); } set { SetValue(MessageProperty, value); MessageDataRefresh(); } } public static readonly DependencyProperty MessageProperty = DependencyProperty.Register("Message", typeof(string), typeof(ThePopMessage), new PropertyMetadata(string.Empty)); public void MessageDataRefresh() { try { if (!string.IsNullOrEmpty(Message)) { NoticeDemoViewModel.OpenMsg(MessageLX, Window.GetWindow(this), "通知", Message); } } catch (Exception ex) { } } #endregion } }