Prism - MVVM模式下,StackPanel中增加和删除View(UserControl)

一、现实效果

在学习Prim,看官方的例子 03-CustomRegions 只是一个简单演示,这里用MVVM方式做个了相对完整的例子,实现效果如图:

123

点击Add,右侧StackPanel中增加一个View(也即UserControl),点击Remove,逐个删除。

 

二、项目结构

项目源码:源码下载

image

 

三、其它类型Adapter参考

 

https://github.com/AHRQ/MONAHRQ-Open-Source/tree/master/Source/Monahrq.Theme/Adapters

DockPanelRegionAdapter.cs
StackPanelRegionAdapter.cs
TabControlRegionAdapter.cs

 

https://github.com/adicunningham/CatWorkbookPrism/tree/master/Src/CatWorkbookPrismPoc.Infrastructure/RegionAdators

RibbonRegionAdapter.cs
StackPanelRegionAdapter.cs

 

https://github.com/zhouhualing/RenixTestCenter/tree/master/PL/Framework/Library.PL.Core/Src/RegionAdapters

CustomItemsControlRegionAdapter.cs 
PanelRegionAdapter.cs 
StackPanelRegionAdapter.cs
ToolBarTrayRegionAdapter.cs
WindowRegionAdapter.cs

 

posted on 2019-05-26 18:57  IUpdatable  阅读(488)  评论(0编辑  收藏  举报

导航