Here we unify the appellation of some names in Prism.
1.Shell Main program Container
2.Region content Area
3.Module Module
4.WPF is not a special case, it means WPF and Silverlight
A. WPF content Controls
Inherited from the ContentControl control, we call it the content control.
<contentcontrol content= "" ></ContentControl>
The ContentControl control defines a content that, in the absence of a frame, can also be used as a section. However, in order to meet the needs of the UI, we also need a variety of different controls to be content areas, such as Tabcontrol,dockpanel, Selector and so on. Some controls inherit from ItemsControl belonging to the collection control and not to the content control. But they can be used as containers for different needs, but they are used in different ways.
In order to unify the operation of the content area, PRISM provides an adaptive mode, and it also provides a mapping relationship between the control and the region. The operation of the different controls that can act as a container are unified into region operation mode.
Prism has three built-in controls that can be used as a content area fitting object
ContentControl
ItemsControl
Selector
It looks like there are only three, but it can be as long as other controls that inherit from these three controls. The following is a description of how to use it.
Two. The basic operation of region, the following with Hello World as Example 1. Register the content area in the shell
The following code, Http://www.codeplex.com/CompositeWPF is the prism registered namespace.
A content area named Mainregion is registered with the Regionmanager attached property regionname
<window x:class= "Helloworldsample.shell"
xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/ Presentation "
xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
xmlns:cal=" http:// Www.codeplex.com/CompositeWPF "
title=" Composite application Library Sample "width=" height= ">
" <contentcontrol cal:regionmanager.regionname= "mainregion"/>
</Window>