1
votes

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?

1

1 Answers

0
votes

This is similiar to Prism 2 SL : Remove View from Region when button clicked

I am going to go with a controller class for this as well.