diff --git a/Source/Changelog.txt b/Source/Changelog.txt index 27fab31..4d56c1a 100644 --- a/Source/Changelog.txt +++ b/Source/Changelog.txt @@ -10,7 +10,9 @@ Contact and Information: http://www.hardcodet.net CHG DataContext is also assigned to ContextMenu, and properly coerced for ToolTips and Popups. Also checks whether target item has a binding on the DataContext (does not just override if DataContext is null). - +CHG The LeftClickCommand now executes with a delay in order to mak sure + it's not a double-click. +FIX Removed debug output in WindowMessageSink. ---------------------------------------------------------------------------- diff --git a/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd b/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd index cd094d6..42e21f9 100644 --- a/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd +++ b/Source/NotifyIconWpf/Diagrams/TaskbarIcon Overview.cd @@ -1,10 +1,9 @@  - + - @@ -14,11 +13,18 @@ - + ABAEAAAAAAAAAAABAAAAAAAAAAAAAAAAAIAKAIAAAAA= PopupActivationMode.cs + + + + AAAAAAAAAAAAAQAAAAAAABAAAAAAAAAAAAAAAEEAAAA= + BalloonIcon.cs + + \ No newline at end of file diff --git a/Source/NotifyIconWpf/Interop/WindowMessageSink.cs b/Source/NotifyIconWpf/Interop/WindowMessageSink.cs index 710fa06..1653525 100644 --- a/Source/NotifyIconWpf/Interop/WindowMessageSink.cs +++ b/Source/NotifyIconWpf/Interop/WindowMessageSink.cs @@ -233,17 +233,14 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop switch (lParam) { case 0x200: -// Debug.WriteLine("MOVE"); MouseEventReceived(MouseEvent.MouseMove); break; case 0x201: - Debug.WriteLine("left down 1"); MouseEventReceived(MouseEvent.IconLeftMouseDown); break; case 0x202: - Debug.WriteLine("left up"); if (!isDoubleClick) { MouseEventReceived(MouseEvent.IconLeftMouseUp); @@ -252,69 +249,57 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop break; case 0x203: - Debug.WriteLine("left click 2"); isDoubleClick = true; MouseEventReceived(MouseEvent.IconDoubleClick); break; case 0x204: - Debug.WriteLine("right click 1"); MouseEventReceived(MouseEvent.IconRightMouseDown); break; case 0x205: - Console.Out.WriteLine("right mouse up"); MouseEventReceived(MouseEvent.IconRightMouseUp); break; case 0x206: //double click with right mouse button - do not trigger event - Debug.WriteLine("right click 2"); break; case 0x207: - Debug.WriteLine("middle click 1"); MouseEventReceived(MouseEvent.IconMiddleMouseDown); break; case 520: - Debug.WriteLine("mouse up middle"); MouseEventReceived(MouseEvent.IconMiddleMouseUp); break; case 0x209: //double click with middle mouse button - do not trigger event - Debug.WriteLine("middle click 2"); break; case 0x402: - Debug.WriteLine("balloon shown"); BallonToolTipChanged(true); break; case 0x403: case 0x404: - Debug.WriteLine("balloon close"); BallonToolTipChanged(false); break; case 0x405: - Debug.WriteLine("balloon clicked"); MouseEventReceived(MouseEvent.BalloonToolTipClicked); break; case 0x406: - Debug.WriteLine("show custom tooltip"); ChangeToolTipStateRequest(true); break; case 0x407: - Debug.WriteLine("close custom tooltip"); ChangeToolTipStateRequest(false); break; default: - Debug.WriteLine("Unhandled message ID: " + lParam); + Debug.WriteLine("Unhandled NotifyIcon message ID: " + lParam); break; } diff --git a/Source/NotifyIconWpf/TaskbarIcon.cs b/Source/NotifyIconWpf/TaskbarIcon.cs index 320aa42..2a4ff06 100644 --- a/Source/NotifyIconWpf/TaskbarIcon.cs +++ b/Source/NotifyIconWpf/TaskbarIcon.cs @@ -156,6 +156,7 @@ namespace Hardcodet.Wpf.TaskbarNotification /// /// An optional animation for the popup. /// The time after which the popup is being closed. + /// Submit null in order to keep the balloon open inde /// /// If /// is a null reference. diff --git a/Source/Sample Project/App.xaml b/Source/Sample Project/App.xaml index e3eec8e..e4e63cf 100644 --- a/Source/Sample Project/App.xaml +++ b/Source/Sample Project/App.xaml @@ -1,12 +1,12 @@  + StartupUri="Main.xaml"> - + diff --git a/Source/Sample Project/App.xaml.cs b/Source/Sample Project/App.xaml.cs index 3ddc729..0764b0a 100644 --- a/Source/Sample Project/App.xaml.cs +++ b/Source/Sample Project/App.xaml.cs @@ -4,6 +4,7 @@ using System.Configuration; using System.Data; using System.Linq; using System.Windows; +using Hardcodet.Wpf.TaskbarNotification; namespace Samples { @@ -12,5 +13,6 @@ namespace Samples /// public partial class App : Application { + } } diff --git a/Source/Sample Project/Commands/CommandBase.cs b/Source/Sample Project/Commands/CommandBase.cs index c841986..9b47695 100644 --- a/Source/Sample Project/Commands/CommandBase.cs +++ b/Source/Sample Project/Commands/CommandBase.cs @@ -1,4 +1,6 @@ using System; +using System.ComponentModel; +using System.Windows; using System.Windows.Input; using System.Windows.Markup; @@ -58,7 +60,18 @@ namespace Samples.Commands /// public virtual bool CanExecute(object parameter) { - return true; + return IsDesignMode ? false : true; + } + + + public static bool IsDesignMode + { + get + { + return (bool) + DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)) + .Metadata.DefaultValue; + } } } } diff --git a/Source/Sample Project/Commands/HideMainWindowCommand.cs b/Source/Sample Project/Commands/HideMainWindowCommand.cs index eae7c0e..694fb1f 100644 --- a/Source/Sample Project/Commands/HideMainWindowCommand.cs +++ b/Source/Sample Project/Commands/HideMainWindowCommand.cs @@ -18,7 +18,7 @@ namespace Samples.Commands public override bool CanExecute(object parameter) { - return Application.Current.MainWindow.IsVisible; + return !IsDesignMode && Application.Current.MainWindow.IsVisible; } diff --git a/Source/Sample Project/Commands/ShowMainWindowCommand.cs b/Source/Sample Project/Commands/ShowMainWindowCommand.cs index c499c85..f3bccc9 100644 --- a/Source/Sample Project/Commands/ShowMainWindowCommand.cs +++ b/Source/Sample Project/Commands/ShowMainWindowCommand.cs @@ -20,7 +20,7 @@ namespace Samples.Commands public override bool CanExecute(object parameter) { - return Application.Current.MainWindow.IsVisible == false; + return !IsDesignMode && Application.Current.MainWindow.IsVisible == false; } } diff --git a/Source/Sample Project/Images/Preferences.png b/Source/Sample Project/Images/Preferences.png new file mode 100644 index 0000000..cd420d7 Binary files /dev/null and b/Source/Sample Project/Images/Preferences.png differ diff --git a/Source/Sample Project/Main.xaml b/Source/Sample Project/Main.xaml new file mode 100644 index 0000000..ffe00d0 --- /dev/null +++ b/Source/Sample Project/Main.xaml @@ -0,0 +1,191 @@ + + + + + + + + + + +