You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am probably doing something wrong but, using TaskbarIcon from H.NotifyIcon.Wpf, I would like to ha a MenuItem Command binding to a IRelayCommand (from CommunityToolkit.Mvvm.Input) property of the encompassing window, i.e.:
You need to specify the DataContext for Window({Binding RelativeSource={RelativeSource Self}}) or TaskbarIcon({Binding RelativeSource={RelativeSource AncestorType=Window}}).
The reason the current code doesn't work is because the ContextMenu doesn't belong to the window's visual tree as far as I know. Therefore, it does not have access to Window. But it will inherit DataContext from TaskbarIcon, because this case is taken into account in the library.
What would you like to be added:
I am probably doing something wrong but, using
TaskbarIcon
fromH.NotifyIcon.Wpf
, I would like to ha a MenuItem Command binding to aIRelayCommand
(fromCommunityToolkit.Mvvm.Input
) property of the encompassing window, i.e.:MainWindow.xaml :
MainWindow.xaml.cs:
Why is this needed:
To aid in mvvm scenarios
For which Platform:
Anything else we need to know?
The text was updated successfully, but these errors were encountered: