Hi,
Based on my understanding, the default implementation of TabControl in WPF inherits from Selector type. Therefore, Prism provides a specific region adapter for selectors, called SelectorRegionAdapter.
As you can see, when a View is added to the region, and that region is a Selector, a new item is added to the selector corresponding to that View.
You can find those classes in the Prism Library, under the namespaces Microsoft.Practices.Prism.Regions and Microsoft.Practices.Prism.Regions.Behaviors.
Hope this helps,
Federico Martinez
http://blogs.southworks.net/fmartinez
Based on my understanding, the default implementation of TabControl in WPF inherits from Selector type. Therefore, Prism provides a specific region adapter for selectors, called SelectorRegionAdapter.
-
The SelectorRegionAdapter is in charge of creating the region, wiring up to the selector (in this case, your TabControl), and attach the SelectorItemsSourceSyncBehavior behavior.
-
The SelectorItemsSourceSyncBehavior is in charge of subscribing to the region events in order to react upon them and synchronize the Selector items with the region Views. The following code describes how this behavior add items to your Selector when Views are added to the region.
privatevoid Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { int startIndex = e.NewStartingIndex; foreach (object newItem in e.NewItems) { this.hostControl.Items.Insert(startIndex++, newItem); } } ... }
You can find those classes in the Prism Library, under the namespaces Microsoft.Practices.Prism.Regions and Microsoft.Practices.Prism.Regions.Behaviors.
Hope this helps,
Federico Martinez
http://blogs.southworks.net/fmartinez