`
Lstoryc
  • 浏览: 78231 次
文章分类
社区版块
存档分类
最新评论

Prism V4 学习笔记 一

 
阅读更多
   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.
 
2. C# 中 virtual 和 abstract 区别
a)     virtual修饰的方法必须有方法实现(哪怕只有一对大括号),abstract修饰的方法不能有实现。

b)    virtual可以被子类重写,abstract必须被子类重写

c)     如果类中的某一函数被abstact修饰,则类名也必须用abstact修饰

d)    Abstract修饰的类不能被创建实例。

e)     C#中如果准备在子类重写父类的方法,则该方法在父类中必须用virtual修饰,在子类中必须用overide修饰,避免了程序员在子类中不小心重写了父类父类方法。

注:用abstract修饰的类只能被继承不能够被实例化。
 
分享到:
评论

相关推荐

    Prism Manual.pdf Prism8框架官方手册 MD 文件转pdf

    Prism是一个流行的框架,它可以帮助开发者构建适用于.NET平台的模块化应用程序。本手册介绍的是Prism框架的官方指南,并说明了如何将Markdown文件转换成PDF格式。Prism框架主要针对WPF(Windows Presentation ...

    silverlight Prism框架API学习

    《深入理解Silverlight Prism框架API》 Silverlight Prism框架,作为一个强大的开发工具,为Silverlight应用程序的构建提供...通过不断的实践和学习,开发者可以充分利用Prism框架,创造出更高效、更灵活的软件系统。

    RPA之BP(Blue Prism)学习资料(send key)

    BP(Blue Prism)是RPA领域中的一个品牌,是英国的一家RPA技术公司,提供先进的软件机器人技术,以支持企业实现业务流程自动化。 在这个文档中,我们将重点介绍BP学习资料中的“send key”功能,即模拟键盘操作。该...

    BluePrism学习--Excel操作

    从给出的文件信息中,我们可以提炼出有关“BluePrism学习--Excel操作”的一些关键知识点,这些知识将集中于BluePrism平台中自动化Excel操作的应用,以及在自动化过程中可能遇到的问题和解决方案。 首先,文档的开头...

    Prism框架学习配套代码部分

    Prism框架学习配套代码部分

    WPF Prism实例(多个实例包含Prism各个重要概念实例)

    1. **模块化(Modularity)**:Prism提供了一种组织大型应用为多个独立模块的方法,每个模块可以有自己的功能和依赖,便于维护和扩展。 2. **依赖注入(Dependency Injection,DI)**:通过容器如Unity或Autofac,...

    RPA Blue Prism BP学习资源从浅到深

    Blue Prism是RPA领域的一个知名厂商,提供了一套完整的RPA软件解决方案,用于帮助企业自动化业务流程,提高效率,减少错误。 Blue Prism的基础培训课程,旨在为学习者提供从浅入深的BP软件学习资源。该课程覆盖了...

    Prism经典案例,Prism经典应用

    1. **模块化(Modularity)**:Prism的核心特性之一是模块化,它允许将大型应用程序分解为小的、独立的模块,每个模块都有自己的功能。这样可以提高代码的可重用性,使得开发和维护变得更加容易。在示例中,你可能会...

    C#Prism 例子与源码

    **Prism 框架详解** Prism 是一个开源的微软 .NET 框架,专为构建可扩展...通过深入学习和使用提供的源码 "Prism-7.2.0.1422",你可以更好地理解并掌握 Prism 的各种特性和工作原理,从而在实际项目中充分利用其优势。

    RPA Blue Prism BP学习资源从浅到深,BP6.4

    BP6.4学习资源旨在为初学者到高级用户提供一个全面的学习路径。学习资源从基础到高级逐步讲解,涵盖了BP软件的安装、配置、操作、设计流程、维护以及最佳实践等方面。从给定的文件内容来看,该资源是一份教学指南,...

    WPF Prism框架学习文章源码

    通过提供的"Prism学习"和"Prismѧϰ"文件,你可以深入学习Prism框架的各种概念和用法,结合源码分析,将有助于你快速掌握这个强大的开发工具。在阅读源码的过程中,注意关注代码结构、模块划分、依赖注入的实现以及...

    BluePrism基础学习资料中文

    1. BluePrism机器人自动化介绍 BluePrism机器人自动化是利用软件机器人模拟人类与计算机交互过程中的工作方式,自动化执行业务流程。对于零基础初学者来说,这一部分将会介绍BluePrism的基本概念、流程自动化的优势...

    Prism.Maui-master.zip

    1. **MVVM 模式**:Prism 提倡 Model-View-ViewModel (MVVM) 设计模式,这是一种将业务逻辑与用户界面分离的方法,有助于提高代码的可测试性和可维护性。MVVM 包括三个主要组件:模型(Model)负责数据处理,视图...

    Prism7.1.0.431_WPF_官方中文文档.pdf

    Prism是一个为.NET框架设计的框架,其目的在于帮助开发者构建松散耦合、易于维护和扩展的复合应用程序。Prism提供了设计模式实现,比如模块化开发和模型-视图-视图模型(MVVM)模式。文档中的内容详细介绍了使用...

    WPF Prism 可关闭的TabControl

    在本文中,我们将深入探讨如何在WPF应用中利用Prism框架实现一个可关闭的TabControl。WPF(Windows Presentation Foundation)是.NET Framework的一部分,提供了一种强大的方式来构建丰富的、具有图形用户界面的应用...

    prism模板 vs插件

    prism模板 vs插件

    Prism 4.0安装包

    1. 模块化:Prism提供了模块化功能,允许开发者将大型应用分解为独立的、可独立开发和部署的模块,增强了软件的灵活性和可扩展性。 2. 依赖注入(Dependency Injection, DI):Prism支持多种DI容器,如Unity或Mef,...

    通过实例学习GraphPad+Prism作图的流程

    ### 通过实例学习GraphPad+Prism作图的流程 #### GraphPad Prism简介与优势 GraphPad Prism是一款专为生物医学研究设计的数据分析与可视化工具。相比于常用的Microsoft Excel,GraphPad Prism提供了更为专业的数据...

    GraphPad Prism 5.0 usb免安装版

    GraphPad Prism 是一个包括基础生命统计、曲线匹配和科学作图的强大结合体。在一百多个国家有超过 10 万个科学家正在试用 Prism 来分析、绘图和呈现他们的科学数据。 是什么令许多世界上领先的大学、医学中心、研究...

    Prism7.1.0.431_WPF_官方中文文档

    1. **模块化**:Prism提供了一种将大型应用分解为多个独立模块的方法,每个模块都可以单独开发、测试和部署。这有利于代码复用和后期维护。 2. **MVVM(Model-View-ViewModel)模式**:Prism支持MVVM设计模式,鼓励...

Global site tag (gtag.js) - Google Analytics