Bind ListBox To Regions Views

Topics: Prism v4 - WPF 4
Dec 8, 2010 at 2:51 PM

Greetings All!

I would like to bind a list box to a list of views in a given region.  What I already have is a treeview whereby when a user clicks on a node a view is rendered in a region.  The region can end up with multiple views on it depending on the number of nodes the user clicks on.  What I would like is for the end-user to visually see how many views they have open by displaying a view count AND a list of the views so the user can click on a given view and navigate to it.  Anybody have any suggestions on how to bind a list box to a regions views?





Dec 8, 2010 at 4:33 PM

Why not use an event, we use lots of them to pass things back and fourth in our app... You really didn't give enough info, I assume you have viewmodels that are created for each of the views displayed in the region you mentioned. How are you opening the views? I think if I had a little more info I could be more helpful... 



Dec 8, 2010 at 6:14 PM

I ended up using events to manage this.  Yes -- I have a view-model, I am following MVVM.  I ended up using an event aggregtor in my view model.  The view model is navigation aware and I am firing an event in the OnNavigatedTo event.

Dec 9, 2010 at 2:10 AM

Yep - that is the way to go, you pass entire view models around in the app I am working on right now...