mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-29 09:45:37 -05:00
WPF NotifyIcon
--------------
FIX Commands did not work with RoutedCommands which require an explicit target.
ADD Added command target properties for both left and double click commands.
Allows to explicitly define another control as the target of a routed
command.
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@112 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -380,7 +380,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
//show popup once we are sure it's not a double click
|
||||
delayedTimerAction = () =>
|
||||
{
|
||||
LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
|
||||
LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
|
||||
ShowTrayPopup(cursorPosition);
|
||||
};
|
||||
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
|
||||
@@ -402,7 +402,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
//show context menu once we are sure it's not a double click
|
||||
delayedTimerAction = () =>
|
||||
{
|
||||
LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
|
||||
LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
|
||||
ShowContextMenu(cursorPosition);
|
||||
};
|
||||
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
|
||||
@@ -419,7 +419,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
||||
if (me == MouseEvent.IconLeftMouseUp && !isLeftClickCommandInvoked)
|
||||
{
|
||||
//show context menu once we are sure it's not a double click
|
||||
delayedTimerAction = () => LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter);
|
||||
delayedTimerAction = () => LeftClickCommand.ExecuteIfEnabled(LeftClickCommandParameter, LeftClickCommandTarget ?? this);
|
||||
singleClickTimer.Change(WinApi.GetDoubleClickTime(), Timeout.Infinite);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user