최종 사용자 변종 최종 사용자에게 여러 뷰를 제공하기위한 몇 가지보기 변형을 제공

이 단원에서는 같은 여러 사용자 변종 제공하는 방법을 배웁니다 보기 및 최종 사용자가 원하는 선택할 수 보기 런타임에 변형을. 변형 모두에 적용 할 수있는 목록보기상세 뷰 . 이 과정에서 연락처 목록보기가 사용됩니다. 이 두 가지 변종 목록보기 를 통해 구성됩니다 모듈 편집기 . 이 사이를 전환하려면 보기 변형, 특별 ChangeVariant 액션이 사용됩니다. 이 작업을 추가하려면 ViewVariants의 모듈은 응용 프로그램에서 참조됩니다.

이 단원에서는 많은 사용자가 동일한 뷰의 변형 및 최종 사용자가 런타임에 원하는 뷰의 변형을 선택할 수 있도록 제공하는 방법보다 더 배우게됩니다. 변형 동시에 "목록보기"를 적용 할 수있다 "상세보기를." 이 단원에서는 대화 상대 목록보기를 사용합니다. 두 모듈 구성 편집기를 통해 목록보기의 변종입니다. 이보기를 전환하려면 특수 변수 변경 작업을 사용하여 변형. 이 작업 응용 프로그램에서 "보기 변형"모듈에 대한 참조를 추가합니다.

참고 참고
계속하기 전에 다음과 같은 교훈을 검토하기 위해 잠시 시간을내어.
계속하기 전에 다음과 같은 과정을 검토하시기 바랍니다.
  • 비즈니스 클래스 라이브러리 클래스에서 상속 ( XPO / EF)
  • (XPO / EF) 클래스 라이브러리에서 비즈니스 클래스 상속을
  • 변경 필드 레이아웃 및 목록보기 가시성
  • 목록보기에서 필드 레이아웃과 가시성을 변경

 

  • 추가 보기 변종 당신에 모듈을 MySolution.Module의 프로젝트. 찾기 Module.cs ( Module.vb 에서) 파일 MySolution.Module의 에 표시 프로젝트 솔루션 탐색기를 ,이 파일을 두 번 클릭합니다. 모듈 디자이너가 호출됩니다.

에서 도구 상자 의에 탐색 DX. 19.2 : XAF 모듈 탭을 선택합니다. 드래그 ViewVariantsModule의 디자이너의이 탭에서 항목을 필수 모듈 섹션을 참조하십시오.

  • MySolution. 모듈 프로젝트에 "보기 변형"모듈을 추가합니다. MySolution.module 항목은 Module.cs (Module.vb) 파일을 찾을 솔루션 탐색기에 표시 한 다음 파일을 두 번 클릭합니다. 발신 모듈 디자이너.

 XAF 모듈 탭 : 도구 상자에서, 탐색 DX.19.2합니다. "보기 변형 모듈", "디자이너 필요한 모듈"섹션이 탭과 드래그를 전망이다.

Tutorial_EM_Lesson2_0

  • 에서 변경 있도록 솔루션을 다시 모듈 디자이너가 받는로드 응용 프로그램 모델 .
  • 인보 모델 편집기를 에 대한 MySolution.Module의 프로젝트. 마우스 오른쪽 버튼을 클릭하면 조회수 노드를 선택 추가 ... | ListView에 .

  • 응용 프로그램 모델에로드 된 모듈 디자이너 변화에 솔루션 다시 빌드.

  • 전화 MySolution. 모델 편집기 모듈 프로젝트. 목록보기 | "추가 ..." "보기"노드를 마우스 오른쪽 단추로 클릭하고 선택합니다.

Tutorial_EM_Lesson2_0_1

 새 노드의 경우, 설정 아이디 "Contact_ListView_AllColumns"과에 재산 ModelClass의 "연락처"를 속성을.

对于新节点,将 Id 属性设置为"Contact_ListView_AllColumns",将 ModelClass 属性设置为"联系人"。

Tutorial_EM_Lesson2_0_2

 

  • Right-click the newly created node and select Generate content. Columns will be generated using information on the specified class (BOModel | Contact node) and its ancestors. Leave these columns as is. This List View will represent the complete variant for the Contact List View.
  • 右键单击新创建的节点并选择"生成内容"。将使用指定类上的信息生成列(BOModel |联系节点)及其祖先。保持这些列不变。此列表视图将表示联系人列表视图的完整变体。

Tutorial_EM_Lesson2_1

 

  • Right-click the Views node and select Add... | ListView. For the new node, set the Id property to "Contact_ListView_Varied" and the ModelClass property to "Contact". Do not generate content for the new node.

  • 右键单击"查看"节点并选择"添加..." |Listview。对于新节点,将 Id 属性设置为"Contact_ListView_Varied",将 ModelClass 属性设置为"联系人"。不要为新节点生成内容。

    Tutorial_EM_Lesson2_2_1

Expand the newly added Contact_ListView_Varied node, right-click the Variants child node and select Add... | Variant.

展开新添加的Contact_ListView_Varied节点,右键单击变体子节点并选择"添加..." |变异。

Tutorial_EM_Lesson2_2_2

For the new node, set the View property to "Contact_ListView", and set the Id and Caption properties to "Few columns".

对于新节点,将 View 属性设置为"Contact_ListView",并将 Id 和标题属性设置为"很少列"。

Tutorial_EM_Lesson2_2_3

  • Right-click the Variants node and select Add... | Variant. For the new node, set the View property to "Contact_ListView_AllColumns", and set the Id and Caption properties to "All columns".

  • 右键单击变体节点并选择"添加..." |变异。对于新节点,将 View 属性设置为"Contact_ListView_AllColumns",并将 Id 和标题属性设置为"所有列"。

    Tutorial_EM_Lesson2_2_4

  • Navigate to the NavigationItems | Items | Default | Items | Contact node. Its View property, specifying the View displayed when choosing the Contact navigation item, is "Contact_ListView" by default. Change it to "Contact_ListView_Varied".

  • 导航到导航项 |项目 |默认值 |项目 |联系节点。默认情况下,其 View 属性(指定选择"联系人"导航项时显示的视图)为"Contact_ListView"。将其更改为"Contact_ListView_Varied"。。

    Tutorial_EM_Lesson2_2_5

  • Run the WinForms or ASP.NET application. Select the Contact item in the navigation control. For the displayed Contact List View, the ChangeVariant Action will be activated. This Action's items represent the view variants specified in the Model Editor.

  • 运行 WinForms 或ASP.NET应用程序。选择导航控件中的"联系人"项。对于显示的联系人列表视图,将激活"更改变量"操作。此操作的项表示模型编辑器中指定的视图变体。

    Tutorial_EM_Lesson2_3

    Note 注意
    You can use the Index property to specify the sort order of variants in the ChangeVariant Action drop-down list. Additionally, you can set the Current property of the Variants node to specify the default variant.
    可以使用 Index 属性在"更改变体操作"下拉列表中指定变体的排序顺序。此外,还可以设置变体节点的"当前"属性以指定默认变体。

 

  • Optionally, you can add view variants to the navigation control. For this purpose, invoke the Model Editor and set the GenerateRelatedViewVariantsGroup property of the NavigationItems node to true.

  • 或者,您可以将视图变体添加到导航控件。为此,调用模型编辑器,并将导航项节点的"生成相关视图VariantsGroup"属性设置为 true。

    Tutorial_EM_Lesson2_5

    Note 注意
    Ensure that the IModelChoiceActionItemChildItemsDisplayStyle.ChildItemsDisplayStyle property of the current navigation group node is set to List (see Change Style of Navigation Items). Otherwise, the view variants will not be added to the navigation control in the WinForms application.

    确保 IModelChoiceActionItemItem 显示样式.子项显示当前导航组节点的样式属性设置为"列表"(请参阅更改导航项的样式)。否则,视图变体将不会添加到 WinForms 应用程序中的导航控件中。

 

As a result, the Contact navigation item will expose child items for each view variant.

因此,"联系人"导航项将公开每个视图变体的子项。

Tutorial_EM_Lesson2_6

 

You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file, located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

당신이이과에서 만든 전화를 모델링 할 수 있습니다 모델 편집기를 변경합니다. 주요 시범 모듈 프로젝트. 데모 응용 프로그램은 메인에 설치되어있는 공중 전의 % \ 문서 \ DevExpress의 데모 % 19.2 \ 구성 요소 \ eXpressApp 프레임 워크 \ MainDemo 기본적으로. 사용 가능한 온라인에서 ASP.NET 버전에서이 AT IS http://demos.devexpress.com/XAF/MainDemo/

.

 

추천

출처www.cnblogs.com/foreachlife/p/Provide-Several-View-Variants-for-End-Users.html