tags:

views:

104

answers:

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?

A: 

This is similiar to http://stackoverflow.com/questions/651460/prism-2-sl-remove-view-from-region-when-button-clicked

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

Thejuan