Context Menu for XAML Treeviewitem (Distinguished by different attributes)

后端 未结 3 1987
太阳男子
太阳男子 2021-02-04 00:40

In XAML, how do you define a context menu for treeviewitems that are distinguished by different attributes?

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 01:07

    You could define the ContextMenus in several styles and select the style using a ItemContainerStyleSelector, based on those attributes.

    Or you could directly specify an ItemContainerStyle and select the appropriate ContextMenu using triggers

提交回复
热议问题