Prism 4 Building Modular MVVM Applications with WPF

所需积分/C币:10 2015-05-04 16:34:45 3.46MB PDF
1
收藏 收藏
举报

[Microsoft Press] Developer's Guide to Microsoft Prism 4 Building Modular MVVM Applications with Windows Presentation Foundation and Microsoft Silverlight.pdf
D卫 VELOPER S GUIDE TO Microsoft Prism 4 Building Modular MVVM Applications using Windows@ Presentation Foundation and Microsoft Silverlight@ Bob Brumfield Geoff cox David hill Brian Noyes Michael puleio Karl Shifflett SBN:9780735656109 This document is provided"as-is" Information and views expressed in this document including url and other Internet Web site references may change without notice. You bear the risk of using it. Some examples depicted herein are provided for illustration only and are fictitious. No real association or connection is intended or should be inferred O 2011 Microsoft. All rights reserved Microsoft, Windows, Windows Server, Windows Vista, Silverlight, Expression blend, msdn, IntelliSense visual C#, Visual Ctt, and Visual Studio are trademarks of the Microsoft group of companies All other trademarks are the property of their respective owners Contents T豆 E TEAM WHO BROUG豆 T YOU THIS GUIDE The Prism 4 Development Team FOREWORD FOREWORD Brian noyes 1 Introduction Why Use Prism? Client Application Development Challenges The Composite Approach Challenges Not Addressed by Prism Getting Started with Prism Prerequisites Installing prism Step 1: Install System Requirements Step 2: Extract the Prism Source code binaries, and documentation Step 3: Register the Prism Binaries xploring Prisi 122245555667778 What's new in this release What's Included Exploring the Documentation Exploring the Quick Starts 10 Exploring the Reference Implementations 11 Upgrading from Earlier Releases 11 An Overview of prism 12 Prism Design goals 12 Prism Key concepts 14 Using Prism Defining the Shel 19 Creating the Bootstrapper 19 Creating a Module 20 Adding a Module view to the Shell 21 More Information 21 Communit 22 What Is a Bootstrapper? 23 2 Initializing Prism Applications 23 Dependency Injection Creating the e shell 24 K ey Decisions 25 C ore scenarios 25 Creating a bootstrapper for your application 25 Implementing the create shell method 25 Implementing the Initialize Shell Method 6 Creating and Configuring the Module catalog 26 Creating and Configuring the Container 27 Core services Application-Specific Services 28 Creating and Configuring the Container in the Unity Bootstrapper 28 Creating and Configuring the Container in the MefBootstrapper 9 More Information 3 Managing Dependencies Between Components 33 Key Decision: Choosing a Dependency Injection Container 34 Considerations for Using the Container 35 Core scenarios 36 Registering Types and Objects 36 Registering Types with the Unity Container 36 Registering Types with MEF 37 Resolving Types and Objects 37 Resolving Instances with Unity 38 Resolving Instances with MEF 39 Using Dependency Injection Containers and Services in Prism 40 Using IServicelocator 41 Considerations for Using IServiceLocator 43 More Information 43 4 Modular Application Development 45 Benefits of Building Modular Applications 46 Prisms Support for Modular Application Development Core Concepts 47 I Module: The Building Block of Modular Applications 47 odule lifetime 48 Module Catalog Controlling when to load a module Integrating Modules with the Application 49 Communication Between modules Dependency Injection and Modular Applications 50 K ey Decisions 51 Partitioning an application into modules 52 Determining the ratio of projects to modules 53 xap File and module Factoring 54 Using Dependency Injection for Loose Coupling 55 Core scenarios 56 Defining a module 56 Registering and Discovering Modules 57 Using Code to Register Modules 57 Using a Xaml File to Register Modules 58 Using a Configuration File to Register Modules 59 Discovering Modules in a Directory 60 Loading ovules 61 Initializing odules 61 Specifying Module Dependencies 62 Specifying dependencies in code 62 Specifying Dependencies in XAML 62 Specifying Dependencies in a Configuration File 62 Loading Modules on Demand 63 Specifying On-Demand Loading in Code 63 Specifying On-Demand Loading in XAML 63 Specifying On-Demand Loading in a Configuration File 63 Requesting On-Demand Loading of a Module 64 Downloading remote modules in the background 64 Preparing a module for remote download 64 Tracking Download Progress 64 Detecting When a Module Has Been Loaded 65 Modules in mee 65 Using mef to Register Modules Programmatically 65 Using mef to Discover Modules in a Directory 66 Using mef to Specify Dependencies in Code Using mef to Specify On-Demand Loading 67 Using mef to Prepare a Module for Remote download 67 More Information 68 Class Responsibilities and Characteristics 69 5 Implementing the MVVM Pattern 69 he view class 70 The view model class The model class 73 Class interactions 74 Data bindin 8 74 mplementing INotify Property Changed 75 Implementing INotify Collection Changed 76 Implementing ICollection View 77 Cor 80 Implementing Command Objects 80 evoking Command Objects from the View 82 evoking Command Methods from the view 83 Data Validation and Error Reporting 84 Implementing IData ErrorInfo 84 Implementing INotify Data ErrorInfo 85 Construction and Configuration 86 Creating the view model using Xaml 87 Creating the view model programmatically 87 Creating a View Defined as a Data Template 88 Key decisions 89 More Information 90 Commands 91 6 Advanced mvvm scenarios 91 Composite Commands 92 Registering and Unregistering Child command 93 Executing Commands in Active Child views Commands within Collections 96 Command behaviors 97 Extend 8 Prism co d behaviors 98 Handling Asynchronous Interactions 101 Retrieving Data and Interacting with Web Services 101 User Interaction patterns 103 Usin an Interaction service 104 Using Interaction Request Objects 105 nitiating Interaction Requests from the view Model 106 Using Behaviors to Implement the Interaction User Experience 108 Advanced Construction and Configuration 110 Using mef to Create the view and view Model 110 Using Unity to Create the View and view Model 111 Using an External Class to Create the View and view Model 113 Testing MVVM Applications 114 Testing INotify Property Changed Implementations 114 Testing Simple Cases esting Computed and Non-Settable Properties 114 Testing Whole object notifications Testing iNotify Data errorInfo Implementations 115 Testing validation Rules 115 Testing the requirements for inotify data errorInfo Implementations 116 esting asynchronous service Calls 117 More Information 119 7 Composing the User Interface 121 UI Layout Concepts 122 Shell 123 Views 123 Composite views 123 Views and Design Patterns 124 Commands, UI Triggers, Actions, and Behaviors 124 Data bindin 8 125 egions 125 Region manage 125 Region Implementation 126 Default region functionality 128 Extending the region implementation 130 View Composition 130 View Discovery 131 View Injection 131 Navigation 131 When to Use view discovery vs. View Injection 131 UI Layout scenarios 132 Implementing the Shell 132 Stock trader ri shell 132 Defining regions 135 Stock Trader RI Shell Regions 136 REgion 138 Using Xaml to add a region 139 Using code to add a region 139 Displaying Views in a Region When the Region Loads 140 Displaying Views in a Region Programmatically 141 Navigation 142 Ordering views in a region 142 Sharing Data Between Multiple Regions 143 Creating Multiple Instances of a Region 145 Creating Views 146 User Controls 146 Custom Controls 147 Data Templates 147 R esources 147

...展开详情
试读 127P Prism 4 Building Modular MVVM Applications with WPF
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚钱or赚积分
最新推荐
Prism 4 Building Modular MVVM Applications with WPF 10积分/C币 立即下载
1/127
Prism 4 Building Modular MVVM Applications with WPF第1页
Prism 4 Building Modular MVVM Applications with WPF第2页
Prism 4 Building Modular MVVM Applications with WPF第3页
Prism 4 Building Modular MVVM Applications with WPF第4页
Prism 4 Building Modular MVVM Applications with WPF第5页
Prism 4 Building Modular MVVM Applications with WPF第6页
Prism 4 Building Modular MVVM Applications with WPF第7页
Prism 4 Building Modular MVVM Applications with WPF第8页
Prism 4 Building Modular MVVM Applications with WPF第9页
Prism 4 Building Modular MVVM Applications with WPF第10页
Prism 4 Building Modular MVVM Applications with WPF第11页
Prism 4 Building Modular MVVM Applications with WPF第12页
Prism 4 Building Modular MVVM Applications with WPF第13页
Prism 4 Building Modular MVVM Applications with WPF第14页
Prism 4 Building Modular MVVM Applications with WPF第15页
Prism 4 Building Modular MVVM Applications with WPF第16页
Prism 4 Building Modular MVVM Applications with WPF第17页
Prism 4 Building Modular MVVM Applications with WPF第18页
Prism 4 Building Modular MVVM Applications with WPF第19页
Prism 4 Building Modular MVVM Applications with WPF第20页

试读结束, 可继续阅读

10积分/C币 立即下载