24
Christian Thilmany Blog: www.flyover18.com UX Architect Microsoft Corporation

Creating UX Applications that Target both Silverlight and WPF

Embed Size (px)

DESCRIPTION

Creating UX Applications that Target both Silverlight and WPF

Citation preview

Page 1: Creating UX Applications that Target both Silverlight and WPF

Christian ThilmanyBlog: www.flyover18.comUX ArchitectMicrosoft Corporation

Page 2: Creating UX Applications that Target both Silverlight and WPF

Session Objectives And Takeaways• Session Objective(s):

• Able to determine RIA composite application scenarios and recommend solutions for the scenarios using Prism for Silverlight and WPF.

• Prism – V2 out now• Provides written and code-example guidance for

composite solution space• Supports targeting both Silverlight & WPF

composite applications

Page 3: Creating UX Applications that Target both Silverlight and WPF
Page 4: Creating UX Applications that Target both Silverlight and WPF
Page 5: Creating UX Applications that Target both Silverlight and WPF
Page 6: Creating UX Applications that Target both Silverlight and WPF
Page 7: Creating UX Applications that Target both Silverlight and WPF
Page 8: Creating UX Applications that Target both Silverlight and WPF

Prism-What’s in the boxPrism – Composite Client Application

Guidance for WPF and SilverlightLibraryReference ImplementationDocumentationQuick-Starts & How-To’sCommunity – CodePlex

Prism 1.0 – WPFReleased July 2008

Prism 2.0 – SilverlightJust Released Feb 2009!

Page 9: Creating UX Applications that Target both Silverlight and WPF
Bob Brumfield
Outline modules and views(?) in colors (Green)
Page 10: Creating UX Applications that Target both Silverlight and WPF
Page 11: Creating UX Applications that Target both Silverlight and WPF

ModulesUnit Of Application Assembly

Collection of Related ComponentsFeature, Services, Views, Data AccessMandatory or Optional or Role SpecificExample: Banking app: Checking Module,

Credit Card Module, Trading Module, News Module

Unit Of DevelopmentIndependent Development/Testing

Unit Of DeploymentUp-Front, Background or On-Demand

Page 12: Creating UX Applications that Target both Silverlight and WPF

ModulesModule Discovery

Pluggable CatalogsModule Loading

Background or On-Demand

Module Module LoaderLoader

Extended InExtended InPrism 2.0!Prism 2.0!

Bob Brumfield
Fix animation
Page 13: Creating UX Applications that Target both Silverlight and WPF

Modules & Catalogs

Page 14: Creating UX Applications that Target both Silverlight and WPF

UI CompositionShell – Application Host WindowRegions – Named Areas For View PlacementViews – Encapsulate UI & Presentation Logic

RegionRegion

Region

Region

RegionRegion

// View InjectionIPositionPresentationModel presentationModel = …;

IRegion mainRegion = regionManager.Regions[ "MainRegion" ];

mainRegion.Add( presentationModel.View );<TabControl RegionManager.RegionName= "MainRegion">

<ItemsControl RegionManager.RegionName= “ResearchRegion” />

<ContentControlRegionManager.RegionName= “ActionRegion” />

Page 15: Creating UX Applications that Target both Silverlight and WPF

UI CompositionView Discovery Composition:

Less ComplexBlack Box ‘App Assembly’ CompositionSelect Views & Pull into Region

New InNew InPrism 2.0!

Prism 2.0!

RegionRegion

Region

Region

RegionRegion

<TabControl RegionManager.RegionName= "MainRegion">

regionManager. RegisterViewWithRegion( "MainRegion", typeof( MainView ) );

Page 16: Creating UX Applications that Target both Silverlight and WPF

Commands and EventsDelegate & Composite Commands

Simplified Command HandlingEvent Aggregator

Loosely Coupled Pub/Sub Events

Module BCustomerPresenter

Module AOrder

Presenter

EventAggregator

Subscrib

e

Pub

lish

Event

Page 17: Creating UX Applications that Target both Silverlight and WPF

Prism Silverlight Logical ArchitectureHOST APPLICATIONHOST APPLICATION LOADING

SERVICESLOADING SERVICES

CORE SERVICES

CORE SERVICES

MODULE PREFFERED SERVICES

MODULE PREFFERED SERVICES

ModulesModulesMODULESMODULES

PresenterPresenter

Model

ViewView

ModelModel

ModuleCatalog

Module Loader

EventAggregator

Logging

RegionManager

Un

ity

Module Initializer

Page 18: Creating UX Applications that Target both Silverlight and WPF

Multi-TargetingUser Experiences

Desktop – In the Office, Full Functionality, Offline RIA – Out of the Office, Functional Subset, Online

WPFApplication

WPFApplication

Silverlight (RIA)Application

Silverlight (RIA)Application

CLR - SilverlightCLR - Silverlight CLR DesktopCLR Desktop

BCLBCL BCLBCL

BROWSER

DESKTOP

Page 19: Creating UX Applications that Target both Silverlight and WPF

Multi-Targeting: StrategiesStart with LCDUse Links and Parallel Project StructuresSeparated Presentation StrategiesKeep single source If not, apply the sieve

#IF SILVERLIGHT#IF SILVERLIGHT

Partial ClassesPartial Classes

Partial MethodsPartial Methods

Separate ClassesSeparate Classes

Rewrite the CodeRewrite the Code

Page 20: Creating UX Applications that Target both Silverlight and WPF

WP

FW

PF

CLR - SilverlightCLR - Silverlight CLR DesktopCLR Desktop

BCLBCL BCLBCL

BROWSER

DESKTOP

Multi-Targeting

Controllers

Models

Presenters

Views

Models

Controllers

Presenters

Views

Page 21: Creating UX Applications that Target both Silverlight and WPF

Stock Trader RI

Page 22: Creating UX Applications that Target both Silverlight and WPF

Where Can You Find It?www.microsoft.com/compositewpfwww.codeplex.com/compositewpfhttp://www.flyover18.com

Page 23: Creating UX Applications that Target both Silverlight and WPF

Summary

PrismLibrary of Patterns for Composite Client

ApplicationsTargets WPF Desktop and Silverlight RIA

ApplicationsView Discovery Composition, Separated

Presentation Patterns, Module CatalogMulti-Targeting to reuse code between Silverlight

and WPFDownload from CodePlex and send us feedback

Page 24: Creating UX Applications that Target both Silverlight and WPF

© 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.