Jun 24, 2013 at 2:54 PM
Edited Jun 24, 2013 at 3:29 PM
I have a Tab control , in which tab item must be generated dynamically (i.e. when I click some button need to add tab item with region ) .
We have a WPF UI , where in there are multiple regions.
1.Top region where we have the search functionaility (we can have an expander to close/open)
- To the Left we have Tab region, where we have to load the Tabs dynamicallay I mean
Once a view gets opened in One tab , clicking on the link present on that Tab should load another View (A1) as a TabA1 .
If user clicks on another link , another Tab should Open (same View) but another instance View(A2) .
And we have Comments region to the extreme right .
- We have status bar in the below .
The Tab region,NOtes,are all dockable .
How can we start with architecture, How many regions , How can we load multiple tabs. please suggest .
How can I achieve this functionality using Prism and MVVM.
Thanks and Regards
Jun 24, 2013 at 8:08 PM
If you define your TabControl
as a region, then each view you inject in it will be represented as a new tab. So basically, when you click the Button to add a view, the corresponding Command would be executed in the corresponding view model,
adding the view to the region; for example, doing something like this:
this.regionManager.Regions["TabRegion"].Add( viewA1 );
this.regionManager.Regions["TabRegion"].Activate( viewA1 ); // Optional, if you want to select the viewA1 as the active tab
The injected view should be automatically wrapped in a TabItem
and added to the
Please let us know if you have any doubts.