Bind Context Menu inside ItemsControl?

前端 未结 2 466
太阳男子
太阳男子 2021-01-03 10:21

How can I add a ContextMenu to a ItemsControl, where:

  • The ItemsSource of the ItemsControl is in the ViewModel of the UserControl holding the ItemsControl
2条回答
  •  走了就别回头了
    2021-01-03 10:49

    It is a known bug in wpf and framework 4.0 try using 4.5 framework. https://connect.microsoft.com/VisualStudio/feedback/details/619658/wpf-virtualized-control-disconnecteditem-reference-when-datacontext-switch

提交回复
热议问题