From 39e4648501c7ce3006be699f6c764054d92a0e97 Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:45:31 +0100 Subject: [PATCH 1/7] Azure pipeline: use NuGet 5.8.0 --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea62dcc..526cae6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,10 +28,10 @@ stages: - task: NuGetToolInstaller@1 inputs: - versionSpec: '5.5.1' + versionSpec: '5.8.0' - task: UseDotNet@2 - displayName: 'Use .NET Core sdk 5.0' + displayName: 'Install .NET Core SDK 5.0' inputs: packageType: sdk version: 5.0.100 From 5455cc5a5da4ab65f5ee12b522572fbe38c920f7 Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:45:55 +0100 Subject: [PATCH 2/7] Set version to 1.1.0 --- src/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.json b/src/version.json index 2fa29c3..136b067 100644 --- a/src/version.json +++ b/src/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.0.9", + "version": "1.1.0", "publicReleaseRefSpec": [ ".*/master$" ], From 011a2e74b4d01ce4da51bfed8eadee486da8d7bb Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:48:21 +0100 Subject: [PATCH 3/7] Fix ShowcaseWindow --- src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml index 4289b90..3d5f4e6 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml +++ b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml @@ -10,7 +10,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - xmlns:local="clr-namespace:Samples" xmlns:commands="clr-namespace:NotifyIconWpf.Sample.ShowCases.Commands" xmlns:showcase="clr-namespace:NotifyIconWpf.Sample.ShowCases.Showcase" MinWidth="750" From 7bf780d0323ab118e430c4cec5464e7f83a2d41e Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:48:57 +0100 Subject: [PATCH 4/7] Fix Process.Start for .Net Core --- src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs | 8 +++++++- .../Showcase/ShowcaseWindow.xaml.cs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs b/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs index 68d9bdc..e780b2f 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs @@ -117,7 +117,13 @@ namespace NotifyIconWpf.Sample.ShowCases private void OnNavigationRequest(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) { - Process.Start(e.Uri.ToString()); + Process.Start(new ProcessStartInfo + { + FileName = e.Uri.ToString(), + // UseShellExecute is default to false on .NET Core while true on .NET Framework. + // Only this value is set to true, the url link can be opened. + UseShellExecute = true + }); e.Handled = true; } } diff --git a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs index e00c9f8..3e1be6e 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Showcase/ShowcaseWindow.xaml.cs @@ -77,7 +77,13 @@ namespace NotifyIconWpf.Sample.ShowCases.Showcase private void OnNavigationRequest(object sender, RequestNavigateEventArgs e) { - Process.Start(e.Uri.ToString()); + Process.Start(new ProcessStartInfo + { + FileName = e.Uri.ToString(), + // UseShellExecute is default to false on .NET Core while true on .NET Framework. + // Only this value is set to true, the url link can be opened. + UseShellExecute = true + }); e.Handled = true; } From d1e3dec5a1433c9e151e9c48321bcd3d169ca488 Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:49:44 +0100 Subject: [PATCH 5/7] Simplify project files --- src/Directory.Build.props | 20 +-- .../NotifyIconWpf.Sample.ShowCases.csproj | 20 +-- .../Properties/Resources.Designer.cs | 93 ------------- .../Properties/Resources.resx | 130 ------------------ .../Properties/Settings.Designer.cs | 26 ---- .../Properties/Settings.settings | 8 -- .../NotifyIconWpf.Sample.Windowless.csproj | 16 +-- .../NotifyIconWpf.Sample.WindowsForms.csproj | 45 ++---- .../Properties/Settings.Designer.cs | 26 ---- .../Properties/Settings.settings | 8 -- src/NotifyIconWpf/NotifyIconWpf.csproj | 8 +- 11 files changed, 30 insertions(+), 370 deletions(-) delete mode 100644 src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.Designer.cs delete mode 100644 src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.resx delete mode 100644 src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.Designer.cs delete mode 100644 src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.settings delete mode 100644 src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.Designer.cs delete mode 100644 src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.settings diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1b33b4c..cb75183 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,13 +1,17 @@ + net45;net462;net472;netcoreapp3.1;net5.0-windows latest true true true $(MSBuildProjectName.Contains('Sample')) + True + embedded + Copyright (c) 2009-2020 Philipp Sumi hardcodet.net - Philipp Sumi + Philipp Sumi, Robin Krom, Jan Karger icon.png https://github.com/hardcodet/wpf-notifyicon git @@ -18,7 +22,6 @@ Source code and extensive sample application available at http://www.hardcodet.net/projects/wpf-notifyicon NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. - NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast @@ -27,17 +30,7 @@ Source code and extensive sample application available at http://www.hardcodet.n - DEBUG;TRACE - True true - embedded - false - - - - true - embedded - True @@ -55,10 +48,11 @@ Source code and extensive sample application available at http://www.hardcodet.n true - + true ..\NotifyIconWpf.snk false + true diff --git a/src/NotifyIconWpf.Sample.ShowCases/NotifyIconWpf.Sample.ShowCases.csproj b/src/NotifyIconWpf.Sample.ShowCases/NotifyIconWpf.Sample.ShowCases.csproj index 080a032..77aa039 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/NotifyIconWpf.Sample.ShowCases.csproj +++ b/src/NotifyIconWpf.Sample.ShowCases/NotifyIconWpf.Sample.ShowCases.csproj @@ -1,26 +1,18 @@  WinExe - net472;netcoreapp3.1;net5.0-windows - true - app.manifest + app.manifest + true + - - - - - - - - - - - + + + diff --git a/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.Designer.cs b/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.Designer.cs deleted file mode 100644 index a678323..0000000 --- a/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.Designer.cs +++ /dev/null @@ -1,93 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18408 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Samples.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Samples.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon Bulb { - get { - object obj = ResourceManager.GetObject("Bulb", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon Computers { - get { - object obj = ResourceManager.GetObject("Computers", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - internal static System.Drawing.Icon NetDrives { - get { - object obj = ResourceManager.GetObject("NetDrives", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - } -} diff --git a/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.resx b/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.resx deleted file mode 100644 index 614a82e..0000000 --- a/src/NotifyIconWpf.Sample.ShowCases/Properties/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\icons\bulb.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\icons\computers.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\icons\netdrives.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.Designer.cs b/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.Designer.cs deleted file mode 100644 index 5df9eba..0000000 --- a/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18408 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Samples.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.settings b/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.settings deleted file mode 100644 index c14891b..0000000 --- a/src/NotifyIconWpf.Sample.ShowCases/Properties/Settings.settings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/NotifyIconWpf.Sample.Windowless/NotifyIconWpf.Sample.Windowless.csproj b/src/NotifyIconWpf.Sample.Windowless/NotifyIconWpf.Sample.Windowless.csproj index b69fab4..5abdd99 100644 --- a/src/NotifyIconWpf.Sample.Windowless/NotifyIconWpf.Sample.Windowless.csproj +++ b/src/NotifyIconWpf.Sample.Windowless/NotifyIconWpf.Sample.Windowless.csproj @@ -1,25 +1,13 @@  WinExe - net45;net472;netcoreapp3.1;net5.0-windows - true - app.manifest + app.manifest + - - - - - - - - - - - diff --git a/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj b/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj index 5d3c24e..5e5b7e5 100644 --- a/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj +++ b/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj @@ -1,26 +1,18 @@  WinExe - net472;netcoreapp3.1;net5.0-windows - true - app.manifest + app.manifest + true + + - - - - - - - - - - - + + Form @@ -31,33 +23,24 @@ Form1.cs + + + True + True + Resources.resx + ResXFileCodeGenerator Resources.Designer.cs - Designer - - True - Resources.resx - True - - - True - Settings.settings - True - + + - - - SettingsSingleFileGenerator - Settings.Designer.cs - - \ No newline at end of file diff --git a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.Designer.cs b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.Designer.cs deleted file mode 100644 index d12cf18..0000000 --- a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WindowsFormsSample.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.settings b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.settings deleted file mode 100644 index e04fc63..0000000 --- a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Settings.settings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/NotifyIconWpf/NotifyIconWpf.csproj b/src/NotifyIconWpf/NotifyIconWpf.csproj index ff566da..13b74bd 100644 --- a/src/NotifyIconWpf/NotifyIconWpf.csproj +++ b/src/NotifyIconWpf/NotifyIconWpf.csproj @@ -4,18 +4,12 @@ Hardcodet.NotifyIcon.Wpf NotifyIcon for WPF NotifyIcon WPF - net45;net472;netcoreapp3.1;net5.0-windows - - - - - - + From 20b0edef4ab92075618b47cd87b7e5cddc5269ce Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:58:12 +0100 Subject: [PATCH 6/7] Update Resources --- .../NotifyIconWpf.Sample.WindowsForms.csproj | 8 ++++---- .../Properties/Resources.Designer.cs | 9 ++++++--- .../Properties/Resources.resx | 8 ++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj b/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj index 5e5b7e5..6178f02 100644 --- a/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj +++ b/src/NotifyIconWpf.Sample.WindowsForms/NotifyIconWpf.Sample.WindowsForms.csproj @@ -1,5 +1,6 @@  + net462;net472;netcoreapp3.1;net5.0-windows WinExe app.manifest true @@ -20,15 +21,14 @@ Form1.cs - - Form1.cs - - True True Resources.resx + + Form1.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.Designer.cs b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.Designer.cs index b374121..9ee2e8a 100644 --- a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.Designer.cs +++ b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18408 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,6 +9,9 @@ //------------------------------------------------------------------------------ namespace NotifyIconWpf.Sample.WindowsForms.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -16,7 +19,7 @@ namespace NotifyIconWpf.Sample.WindowsForms.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -36,7 +39,7 @@ namespace NotifyIconWpf.Sample.WindowsForms.Properties { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsSample.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NotifyIconWpf.Sample.WindowsForms.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.resx b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.resx index d657fca..26b0ac4 100644 --- a/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.resx +++ b/src/NotifyIconWpf.Sample.WindowsForms/Properties/Resources.resx @@ -112,13 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + - ..\icon\led.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Icon\Led.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file From a93c06ed96b95d28b044f7b59f5ac66357bb1b57 Mon Sep 17 00:00:00 2001 From: punker76 Date: Mon, 23 Nov 2020 11:58:19 +0100 Subject: [PATCH 7/7] Fix Warning --- .../Tutorials/06 - Commands/ShowMessageCommand.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NotifyIconWpf.Sample.ShowCases/Tutorials/06 - Commands/ShowMessageCommand.cs b/src/NotifyIconWpf.Sample.ShowCases/Tutorials/06 - Commands/ShowMessageCommand.cs index 7aac104..f108317 100644 --- a/src/NotifyIconWpf.Sample.ShowCases/Tutorials/06 - Commands/ShowMessageCommand.cs +++ b/src/NotifyIconWpf.Sample.ShowCases/Tutorials/06 - Commands/ShowMessageCommand.cs @@ -20,6 +20,10 @@ namespace NotifyIconWpf.Sample.ShowCases.Tutorials return true; } - public event EventHandler CanExecuteChanged; + public event EventHandler CanExecuteChanged + { + add => CommandManager.RequerySuggested += value; + remove => CommandManager.RequerySuggested -= value; + } } } \ No newline at end of file