Prism V2 Tour (2)

Source: Internet
Author: User
Tags xmlns

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.