lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.39k stars 717 forks source link

Unregistering tray icon does not work #240

Open BartoszCichecki opened 2 years ago

BartoszCichecki commented 2 years ago

Describe the bug
Calling Unregister on NotifyIcon has no effect.

To Reproduce
Steps to reproduce the behavior:

  1. Call Unregister
  2. Icon does not disappear from tray menu.

Expected behavior
Tray icon should go away.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context

Looking at the code, ShellIconData is not assigned in public static bool Register(Controls.NotifyIcon notifyIcon, HwndSource parentSource) which is in TrayManager line 47. Looking at the code we should assign the shellIconData returned from interop call back to notifyIcon.ShellIconData.

BartoszCichecki commented 2 years ago

PS: F* amazing work with this library!