WPF treeview contextmenu command parameter
问题 I have TreeView with HierarchicalDataTemplate . On TreeView I have ContextMenu <TreeView Name="_packageTreeView" ItemsSource="{Binding PackageExtendedList}" Behaviors:TreeViewInPlaceEditBehavior.IsEditable="True"> <TreeView.ContextMenu> <ContextMenu StaysOpen="true"> <MenuItem Header="Добавить пакет" Height="20" Command="{Binding AddPackageCommand}" CommandParameter="{Binding ElementName=_packageTreeView, Path=SelectedItem}"> <MenuItem.Icon> <Image Source="/Resources/ManualAdd.png" Width="15"