Modules.
Modules are packages of functionality that can be independently developed, tested, and (optionally)
deployed. In many situations, modules are developed and maintained by separate teams. A typical Prism
application is built frommultiple modules. Modules can be used to represent specific business-related
functionality (for example, profile management) and encapsulate all the views, services, and data models
required to implement that functionality. Modules can also be used to encapsulate common application
infrastructure or services (for example, logging and exception management services) that can be reused across
multiple applications.
Module catalog.
In a composite application, modules must be discovered and loaded at run time by the host
application. In Prism, a module catalog is used to specify which modules to are to be loaded, when they are
loaded, and in what order. The module catalog is used by the ModuleManagerand ModuleLoader
components, which are responsible for downloading the modules if they are remote, loading the module's
assemblies into the application domain, and for initializing the module. Prismallows the module catalog to be
specified in different ways, including programmatically using code, declaratively using XAML, or using a
configuration file. You can also implement a custommodule catalog if you need to Page 20.
Shell.
The shell is the host application into which modules are loaded. The shell defines the overall layout and
structure of the application, but it is typically unaware of the exact modules that it will host. It usually
implements common application services and infrastructure, but most of the application's functionality and
content is implemented within the modules. The shell also provides the top-level window or visual element that
will then host the different UI components provided by the loaded modules.
Views.
Views are UI controls that encapsulate the UI for a particular feature or functional area of the
application. Views are used in conjunction with the MVVM or Model-View-Presenter (MVP) patterns, which are
used to provide a clean separation of concerns between the UI and the application's presentation logic and
data. Views are used to encapsulate the UI and define user interaction behavior, thereby allowing the view to be
updated or replaced independently of the underlying application functionality. Views use data binding to interact
with view model and presenter classes.
View models and presenters. View models are classes that encapsulate the application's presentation logic
and state. They are part of the MVVM pattern. View models encapsulate much of the application's functionality.
Presenters are similar to view models in that they encapsulate the presentation logic and state. They are used
as part of the MVP pattern. Both view models and presenters define properties, commands, and events, to which
controls in the view can data-bind.
Models.
Model classes encapsulate the application data and business logic. They are used as part of the MVVM
or MVP patterns. Models encapsulate data and any associated validation and business rules to ensure data
consistency and integrity.
Commands.
Commands are used to encapsulate application functionality in a way that allows themto be
defined and tested independently of the application's UI. They can be defined as command objects or as
command methods in the view model or presenter. Prismprovides the DelegateCommandclass and the
CompositeCommandclass. The latter is used to represent a collection of commands which are all invoked
together.
Regions.
Regions are logical placeholders defined within the application's UI (in the shell or within views) into
which views are displayed. Regions allow the layout of the application's UI to be updated without requiring
changes to the application logic. Many common controls can be used as a region, allowing views to be
automatically displayed within controls, such as a ContentControl, ItemsControl, ListBox, or TabControl.
Views can be displayed within a region programmatically or automatically. Prismalso provides support for
implementing navigation with regions. Regions can be located by other components through the RegionManager
component, which uses RegionAdapterand RegionBehaviorcomponents to coordinate the display of views
within specific regions.
Navigation.
Navigation is defined as the process by which the application coordinates changes to its UI as a
result of the user's interaction with the application or internal application state changes. Prismsupports two
styles of navigation: state-based navigation, where the state of an existing view is updated to implement simple
navigation scenarios, and view-switching navigation, where new views are created and old views replaced within
the application's UI. View-switching navigation uses a UniformResource Identifier (URI)–based navigation
mechanismin conjunction with Prismregions to allow flexible navigation schemes to be implemented.
EventAggregator.
Components in a composite application often need to communicate with other components
and services in the application in a loosely coupled way. To support this, Prismprovides the EventAggregator
component, which implements a pub-sub event mechanism, thereby allowing components to publish events and
other components to subscribe to those events without either of themrequiring a reference to the other. The
EventAggregatoris often used to allow components defined in different modules to communicate with each
other.
Dependency injection container. The Dependency Injection (DI) pattern is used throughout Prismto allow the
dependencies between components to be managed. Dependency injection allows component dependencies to be
fulfilled at run time, and it supports extensibility and testability. Prismis designed to work with Unity or MEF, or
with any other dependency injection containers via the ServiceLocator.
Services.
Services are components that encapsulate non-UI related functionality, such as logging, exception
management, and data access. Services can be defined by the application or within a module. Services are
often registered with the dependency injection container so that they can be located or constructed as required
and used by other components that depend on them.
Controllers.
Controllers are classes that are used to coordinate the construction and initialization of views that
are to be displayed in a region within the application's UI. Controllers encapsulate the presentation logic that
determines which views are to be displayed. The controller will use Prism's view-switching navigation mechanism,
which provides an extensible URI-based navigation mechanismto coordinate the construction and placement of
views within regions. The Application Controller pattern defines an abstraction that maps to this responsibility.
Bootstrapper.
The Bootstrappercomponent is used by the application to initialize the various Prism
components and services. It is used to initialize the dependency injection container to register any
application-level components and services with it. It is also used to configure and initialize the module catalog
and the shell's view and view model or presenter.
Multi-targeting.
Prismsupports the development of applications that can target both WPF and Silverlight. By
adopting a separated presentation pattern, such as the MVVM or MVP patterns, you can separate the UI of your
application fromits presentation and business logic. View model, presenter, and model classes can be reused in
both WPF and Silverlight versions of the same application. WPF-specific and Silverlight-specific views can then
be defined in a way that encapsulates the UI for each.
- 浏览: 75232 次
相关推荐
WPF Prism
WPF Prism框架学习文章源码
silverlight Prism框架是一款是silverlight项目性能提升,模块分割,使得xap包变小,运行效率提升。
prism模板 vs插件
1. Install Delphi Prism Xe with key:MAAF-SPD7DK-BLAGAD-FEBN 2. Copy PrismXe.slip to C:\Program Files\Embarcadero\Delphi Prism\License 3. Copy sanctuarylib.dll to C:\Program Files\Embarcadero\Delphi ...
1、Prism各个重要概念实例 2、MVVM架构 3、WPF中使用Prism
WPF实现持久化笔记本,MVVM模式,依赖注入
BluePrism中文基础学习资料,适合零基础初学者
Prism经典案例
本章的资源是学习BluePrism针对Excel的简单操作。需要更多资源加微信kone_resource
WPF Prism 依赖注入实现可关闭的TabControl。
MVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMOMVVM PRISM DEMO
prism quickstart
C#+WPF+Prism模块化开发示例。本示例简述了Prism框架的基本应用,包括数据绑定,事件等内容
VS2022的在线插件库中未收录PrismTemplate插件,导致无法直接在VS中安装Prism模板插件。 该插件基于官网插件修改安装支持版本后,可直接安装使用(电脑只有VS2022)。 如果电脑有多版本VS,需要右键在打开方式中选择...
Prism中文文档,完美的prism简介
prism对话服务
Profile Prism 6.03,ICC文件制作软件
Prism(Composite Application Guidance for WPF and Silverlight)是微软模式与实践小组出的一个WPF&Silverlight项目开发的框架,内含了依赖注入、UI整合、command代理、Event聚合等诸多子功能,并可按需选取,是...
通过实例学习GraphPad+Prism作图的流程,中文的哦,好不容易找到的