WPF Show data from multiple DataContexts in ToolTip of ItemsControl

后端 未结 5 2170
清酒与你
清酒与你 2021-01-18 03:54

I am trying to display a tooltip for an item generated by an ItemsControl that needs to pull data from conceptually unrelated sources. For example, say I have a

5条回答
  •  渐次进展
    2021-01-18 04:47

    This is a case where I think it's conceptually more appropriate to do this in the view model than it is in the view anyway. Expose the tooltip information to the view as a property of the view model item. That lets the view do what it's good at (presenting properties of the item) and the view model do what it's good at (deciding what information should be presented).

提交回复
热议问题