Improved trayIcon handling

This commit is contained in:
Darth Affe 2017-08-03 19:37:33 +02:00
parent 1cfc7a3b31
commit 13e66c6356
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,7 @@ namespace KeyboardAudioVisualizer
try try
{ {
_taskbarIcon = (TaskbarIcon)FindResource("TaskbarIcon"); _taskbarIcon = (TaskbarIcon)FindResource("TaskbarIcon");
_taskbarIcon.DoubleClickCommand = ApplicationManager.Instance.OpenConfigurationCommand;
Settings settings = SerializationHelper.LoadObjectFromFile<Settings>(PATH_SETTINGS); Settings settings = SerializationHelper.LoadObjectFromFile<Settings>(PATH_SETTINGS);
if (settings == null) if (settings == null)

View File

@ -10,7 +10,7 @@ namespace KeyboardAudioVisualizer.Controls
[TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))] [TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_MinimizeButton", Type = typeof(Button))] [TemplatePart(Name = "PART_MinimizeButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_IconButton", Type = typeof(Button))] [TemplatePart(Name = "PART_IconButton", Type = typeof(Button))]
public class BlurredDecorationWindow : System.Windows.Window public class BlurredDecorationWindow : Window
{ {
#region DependencyProperties #region DependencyProperties
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
@ -79,7 +79,7 @@ namespace KeyboardAudioVisualizer.Controls
Button minimizeButton = GetTemplateChild("PART_MinimizeButton") as Button; Button minimizeButton = GetTemplateChild("PART_MinimizeButton") as Button;
if (minimizeButton != null) if (minimizeButton != null)
minimizeButton.Click += (sender, args) => Application.Current.MainWindow.WindowState = WindowState.Minimized; minimizeButton.Click += (sender, args) => Hide();
Button iconButton = GetTemplateChild("PART_IconButton") as Button; Button iconButton = GetTemplateChild("PART_IconButton") as Button;
if (iconButton != null) if (iconButton != null)