1

I have a "DataRegion" that is an ItemsControl. I add ViewModels to it and through DataTemplating the views are rendered.

My question is that this ItemsControl now needs logic to do with setting up Commands in menus for the Items (they can't do it themselves as it the logic is dependendant on the number of items, i.e. there must be one item visible all the time)

I want it to be a ViewModel, but can't work out how to instaniate it and associate it to the items control?

I can't bind it to the items control as the region will throw an error. I have added it as a property to the shell and it currently accesses the region views to get to the child viewmodels that it needs to control.

Any better ideas?

4

1 回答 1

0

这类似于Prism 2 SL:单击按钮时从区域中删除视图

我也将为此使用一个控制器类。

于 2009-03-30T08:42:58.283 回答