1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
| using System.Windows;
| namespace PluginListener
| {
| /// <summary>
| /// Alert.xaml 的交互逻辑
| /// </summary>
| public partial class Alert : Window
| {
| public Alert()
| {
| InitializeComponent();
| }
|
| public void Open(string msg)
| {
| Dispatcher.Invoke(() =>
| {
| label.Content = msg;
| this.Show();
| });
| }
|
| public void DoHide()
| {
| Dispatcher.Invoke(() =>
| {
| this.Hide();
| });
| }
|
| public void DoClose()
| {
| Dispatcher.Invoke(() =>
| {
| this.Close();
| });
| }
|
| protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
| {
| e.Cancel = true;
| }
|
| private void Button_Click(object sender, RoutedEventArgs e)
| {
| this.Hide();
| }
| }
| }
|
|