diff --git a/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd b/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd
index dc1f29e..cd094d6 100644
--- a/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd
+++ b/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd
@@ -8,10 +8,17 @@
- N6qdVIeUdLmQtSUbiJhEGdYRjvJYXlhbEVBBKuPRO5s=
+ N6qdVIeUdLmQtSUbiJhEGdYRjvJYXlhbEVBDKuPRO5s=
TaskbarIcon.cs
+
+
+
+ ABAEAAAAAAAAAAABAAAAAAAAAAAAAAAAAIAKAIAAAAA=
+ PopupActivationMode.cs
+
+
\ No newline at end of file
diff --git a/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs b/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
index 0166c6a..60e7606 100644
--- a/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
+++ b/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
@@ -782,9 +782,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
///
protected RoutedEventArgs RaiseTrayLeftMouseDownEvent()
{
- //first raise event, then command
RoutedEventArgs args = RaiseTrayLeftMouseDownEvent(this);
- LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
return args;
}
diff --git a/Source/NotifyIconWpf/TaskbarIcon.cs b/Source/NotifyIconWpf/TaskbarIcon.cs
index cd3afa4..320aa42 100644
--- a/Source/NotifyIconWpf/TaskbarIcon.cs
+++ b/Source/NotifyIconWpf/TaskbarIcon.cs
@@ -369,14 +369,21 @@ namespace Hardcodet.Wpf.TaskbarNotification
Point cursorPosition = new Point();
WinApi.GetCursorPos(ref cursorPosition);
+ bool isLeftClickCommandInvoked = false;
+
//show popup, if requested
if (me.IsMatch(PopupActivation))
{
if (me == MouseEvent.IconLeftMouseUp)
{
//show popup once we are sure it's not a double click
- delayedTimerAction = () => ShowTrayPopup(cursorPosition);
+ delayedTimerAction = () =>
+ {
+ LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
+ ShowTrayPopup(cursorPosition);
+ };
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
+ isLeftClickCommandInvoked = true;
}
else
{
@@ -392,8 +399,13 @@ namespace Hardcodet.Wpf.TaskbarNotification
if (me == MouseEvent.IconLeftMouseUp)
{
//show context menu once we are sure it's not a double click
- delayedTimerAction = () => ShowContextMenu(cursorPosition);
+ delayedTimerAction = () =>
+ {
+ LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
+ ShowContextMenu(cursorPosition);
+ };
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
+ isLeftClickCommandInvoked = true;
}
else
{
@@ -401,6 +413,15 @@ namespace Hardcodet.Wpf.TaskbarNotification
ShowContextMenu(cursorPosition);
}
}
+
+ //make sure the left click command is invoked on mouse clicks
+ if (me == MouseEvent.IconLeftMouseUp && !isLeftClickCommandInvoked)
+ {
+ //show context menu once we are sure it's not a double click
+ delayedTimerAction = () => LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
+ singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
+ }
+
}
#endregion