正しい質問をしたことを願っていますが、これが私の状況です。私TreeViewItemは実装しています。その中にさまざまなプロパティを設定/追加しますが、そのうちの 1 つがContextMenu. 私がやりたいのは、関数などに渡さずに に追加MenuItemsすることだけです。ContextMenu
TreeViewItemwithを実装する方法は次のContextMenuとおりです。
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
}
};
どうもありがとう!