命令参数在Treeview上下文菜单中为null [英] command parameter getting null in treeview contextmenu

查看:80
本文介绍了命令参数在Treeview上下文菜单中为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在树形视图中,我希望通过命令参数在其上下文菜单中打开的项目对象.但是我目前正在获得空值.

样本,

Hi,

In treeview I want item object on which context menu is open through command parameter. But I am getting null value currently.

Sample,

<treeview.contextmenu>
              <contextmenu>

           <menuitem header="Check">
                        Command="{Binding StartPuttyCommand}"
                        CommandParameter="{Binding RelativeSource={RelativeSource   AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}"/&gt;
              </menuitem></contextmenu>
</treeview.contextmenu>



在此先感谢
Brinda.



Thanks in Advance
Brinda.

推荐答案


这篇关于命令参数在Treeview上下文菜单中为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆