Create a region in code?...

Nov 22, 2012 at 4:44 PM


I'm adding Tabitems dynamically using a ObservableCollection in my ViewModel, but I want to assign each Tabitem with a Region name so I can inject a View.

How do you create the Region property in ContentControl  for the Tabitem in code to accomplish this?


Nov 27, 2012 at 4:59 AM
Edited Nov 27, 2012 at 5:00 AM

I'm not sure I understand specifically the scenario.  The general approach for handling run time values (which is what I assume the dynamic Tabitems are) is to use an abstract factory.  Check out as well as this collection of answers for inspiration:  

Randy Levy
Enterprise Library support engineer