H.NotifyIcon
H.NotifyIcon copied to clipboard
[Core] Add ability to use context menus and other events related components
What would you like to be added:
Why is this needed:
For which Platform:
- [ ] All
- [ ] WPF
- [ ] WinUI
- [ ] Uno
- [x] Core
Anything else we need to know?
At the moment, I don't know the reason why the console application does not receive events on the MessageWindow (although the platform libraries work with the same code). It is possible that this is precisely due to the lack of a full-fledged UI thread and the corresponding Win32 calls that allow the process to receive the necessary messages. I do not promise that it will be in the near future.
You can test the behavior in your particular case by subscribing to TrayIcon.MessageWindow.MouseEventReceived. If you get these events, you can use the H.NotifyIcon.PopupMenus package to create a context menu. Here is also a sample code using PopupMenu: https://github.com/HavenDV/H.NotifyIcon/blob/23cb9fb9f2139fa196966ec78ac2f6efe23efcf7/src/libs/H.NotifyIcon.Shared/TaskbarIcon.ContextMenu.cs#L214-L246
Is it possible to change a context menu item property (like Text
) in the runtime?🤔
Is it possible to change a context menu item property (like
Text
) in the runtime?🤔
It will depend on the ContextMenu mode for WinUI. Binding is currently not available for the default mode, but should work for other modes. At the same time, changing the text at the moment between opening the ContextMenu should work for all modes.
Added