-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShowMessageCommand.cs
35 lines (30 loc) · 1.18 KB
/
ShowMessageCommand.cs
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
using System;
using System.Windows;
using System.Windows.Input;
namespace SkinText {
//for TaskbarIcon
public class ShowMessageCommand : ICommand {
public void Execute(object parameter) {
//MessageBox.Show(parameter.ToString());
foreach (Window item in Application.Current.Windows) {
if (item.Title.Equals(nameof(SkinText))) {
if (item.Visibility == Visibility.Hidden) {
item.Show();
item.Activate();
}
else {
item.Show();
item.Hide();
}
}
}
}
public bool CanExecute(object parameter) => true;
public event EventHandler CanExecuteChanged {
add { throw new NotSupportedException(); }
#pragma warning disable RECS0029 // Warns about property or indexer setters and event adders or removers that do not use the value parameter
remove { }
#pragma warning restore RECS0029 // Warns about property or indexer setters and event adders or removers that do not use the value parameter
}
}
}