Traverse window using CommandParameter from ContextMenu
The goal is to hide / show the window from the task tray using Hardcoded WPF NotifyTrayIcon
in an MVVM solution. The problem is it CommandParameter
always appears to be null, which of course causes the code to fail. I have tried several different bindings including:
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}"
CommandParameter="{Binding ElementName=window, Mode=OneWay}"
and so on but everything returns zero, any suggestions?
thank
+3
source to share