|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- 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
- {
- /// <summary>
- /// TheMessage.xaml 的交互逻辑
- /// </summary>
- public partial class TheMessage : 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 TheMessage()
- {
- InitializeComponent();
- Width = 40;
- Height = 40;
- }
- public void Register()
- {
-
- }
-
- #region 弹窗属性
- [Category("消息类型")]
- public MessageBoxStyle MessageLX
- {
- get { return (MessageBoxStyle)GetValue(MessageLXProperty); }
- set { SetValue(MessageLXProperty, value); }
- }
- public static readonly DependencyProperty MessageLXProperty =
- DependencyProperty.Register("MessageLX", typeof(MessageBoxStyle), typeof(TheMessage), new PropertyMetadata(MessageBoxStyle.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(TheMessage), new PropertyMetadata(string.Empty));
- [Category("消息数据")]
- public bool ReturnValue
- {
- get { return (bool)GetValue(ReturnValueProperty); }
- set
- {
- SetValue(ReturnValueProperty, value);
- }
- }
- public static readonly DependencyProperty ReturnValueProperty =
- DependencyProperty.Register("ReturnValue", typeof(bool), typeof(TheMessage), new PropertyMetadata(false));
- public void MessageDataRefresh()
- {
- try
- {
- if (!string.IsNullOrEmpty(Message))
- {
- if (MessageBoxStyle.question == MessageLX)
- {
- ReturnValue = false;
- bool? bo= new MyMessageBox(MessageLX, Message).ShowDialog();
- ReturnValue=bo.Value;
- }
- else
- {
- new MyMessageBox(MessageLX, Message).ShowDialog();
- }
- }
- }
- catch (Exception ex)
- {
-
- }
- }
- #endregion
- }
- }
|