build better wpf & silverlight...
TRANSCRIPT
![Page 1: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/1.jpg)
![Page 2: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/2.jpg)
Build Better WPF & Silverlight applications
using Prism v2
![Page 3: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/3.jpg)
• The Problem:– Client Applications can be Difficult!– How Do You Make The Application
Dynamic, Customizable, Extensible, Testable?
• The Solution:– Break Application Into Modules– Manage Dependencies & Interactions– Re-assemble Application From Modules
• Prism = Patterns For Building Client Apps
Client Application Challenges
![Page 4: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/4.jpg)
• Prism – Composite Client Application Guidance for WPF and Silverlight– Library– Reference Implementation– Documentation– Quick-Starts & How-To’s– Community – CodePlex
• Prism 1.0 – WPF– Released July 2008
• Prism 2.0 – WPF & Silverlight– Released Feb 2009
• Prism 4.0 – WPF & Silverlight 4.0– Coming Soon!
What’s In The Box?
![Page 5: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/5.jpg)
Prism Core Concepts
![Page 6: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/6.jpg)
Reference Implementation
![Page 7: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/7.jpg)
Prism Quick Start Templates
Available From : http://blogs.msdn.com/dphill
![Page 8: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/8.jpg)
• StockTrader Reference Implementation
![Page 9: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/9.jpg)
What Are Modules?• Unit Of Application Assembly
– Collection of Related Components– Feature, Services, Views, Data Access– Slice & Dice: Mandatory, Optional, Role Specific
• Unit Of Development– Independent Development– Independent Testing
• Unit Of Deployment– Up-Front, Background or On-Demand
![Page 10: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/10.jpg)
Finding & Loading Modules• Module Discovery
– Pluggable Module Catalogs
• Module Loading– Background or On-Demand
Module Loader
![Page 11: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/11.jpg)
• Shell – Application Host Window• Regions – Named Areas For View Placement• Views – Module UI & Presentation Logic• Using Code to Show Views:
Building the UI
Region
Region
Region
<ContentControlRegionManager.RegionName=“BuySellRegion” />
MyView view = …;
IRegion buySellRegion =regionManager.Regions[ “BuySellRegion" ];
buySellRegion.Add( view );
<ItemsControlRegionManager.RegionName=“DataRegion">
![Page 12: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/12.jpg)
• Automatically Showing Views:– Less Complex– Black Box ‘App Assembly’ Composition– Select Views & Pull into Region
Building the UI
Region
Region
Region
<ContentControlRegionManager.RegionName=“BuySellRegion” />
regionManager.RegisterViewType(“BuySellRegion", typeof( BuySellView ) );
![Page 13: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/13.jpg)
• Common UI Patterns– Supervising Presenter– Presentation Model (“Model-View-ViewModel”)
• Views:– Encapsulate UI & UI Logic– Minimal Code Behind– UI Designer Friendly
• Presenters:– Presentation Logic
& State– Unit Testable– View Independent
Separated Presentation
SupervisingPresenter
Model
View
PresentationModel ModelView
![Page 14: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/14.jpg)
Commands and Events• Delegate Commands
– Delegate Based Commanding Pattern
• Composite Commands– Multiple Handler Command Routing
• Event Aggregator– Loosely Coupled Pub/Sub Events
Module BCustomerPresenter
Module AOrder
Presenter
EventAggregator
SubscribePublishEvent
![Page 15: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/15.jpg)
• Separated Presentation
![Page 16: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/16.jpg)
WPF
SILV
ERLI
GH
T
CLR - Silverlight CLR Desktop
BCL BCL
BROWSER DESKTOP
Multi-Targeting• Desktop vs RIA Applications
– Desktop: In the Office, Full FunctionalityOffline Capable
– RIA: Out of the Office, Functional Subset, Online Only
Controllers
Models
Presenters
Views
Models
Controllers
Presenters
Views
![Page 17: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/17.jpg)
• Multi-Targeting
![Page 18: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/18.jpg)
• Library of Patterns for Client & RIA Applications– Modularity, Composition, Separated Presentation…
• Solid but Flexible Architectural Foundation– Promotes Re-use, Unit Testing, Independent Development– Supports Design-Time & Run-Time Extensibility
• Multi-Targeting– Promotes Re-use across WPF & Silverlight– Support Multi User Experience or Migration
• Code, Reference Implementation, Documentation & Quick-Starts Available on MSDN & CodePlex
• What’s Next?– Next Release for WPF & Silverlight 4.0 Spring 2010– Send us feedback & ideas for Prism 4.0!
Summary
![Page 19: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/19.jpg)
Prism Roadmap
• What’s Coming in Prism 4.0?– Silverlight 4.0 and WPF 4.0 Support– More ViewModel Pattern Guidance– Managed Extensibility Framework (MEF) Support– Guidance For Out of Browser Applications– ???
2009 2010
3.0 4.0
Prism 2.0 Prism 2.1 Prism 4.0
![Page 20: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/20.jpg)
Where Can You Find It?• www.microsoft.com/prism• www.codeplex.com/prism
![Page 21: Build Better WPF & Silverlight applicationsdownload.microsoft.com/download/4/2/B/42B4C0CE-4225-4D56-BB6… · Presenter Model View Presentation. Model. View Model. Commands and Events](https://reader036.vdocuments.site/reader036/viewer/2022081613/5fb65164bba6c052e14de745/html5/thumbnails/21.jpg)
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.