【发布时间】:2013-08-06 12:36:21
【问题描述】:
我希望我问的是正确的问题,但这是我的情况。我有一个正在实施的TreeViewItem。在其中我设置/添加各种属性,其中之一是ContextMenu。我要做的就是将MenuItems 添加到ContextMenu 而不传递给函数等。
以下是我使用ContextMenu 实现TreeViewItem 的方法:
public static TreeViewItem Item = new TreeViewItem() //Child Node
{
ContextMenu = new ContextMenu //CONTEXT MENU
{
Background = Brushes.White,
BorderBrush = Brushes.Black,
BorderThickness = new Thickness(1),
//**I would like to add my MENUITEMS here if possible
}
};
非常感谢!
【问题讨论】:
标签: c# wpf contextmenu menuitem