26
Copyright © Brian Noyes, All rights reserved Windows Desktop Development Landscape & WPF Top Ten Power Features Brian Noyes CTO and Co-founder, Solliance [email protected] , @briannoyes

Understanding the Windows Desktop App Development Landscape + Top 10 WPF Power Features

Embed Size (px)

Citation preview

Page 1: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Windows Desktop Development Landscape &

WPF Top Ten Power FeaturesBrian Noyes

CTO and Co-founder, [email protected], @briannoyes

Page 2: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

About Brian Noyes

CTO and Co-founder, Solliancewww.solliance.net

Microsoft Regional Director

Microsoft MVP

Pluralsight authorwww.pluralsight.com

te [email protected]

@briannoyes

http://briannoyes.net

Web API Insider, Windows Azure Insider,Window Store App Insider, C#/VB Insider

Page 3: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Agenda

Windows Desktop Development Landscape UI Frameworks XAML Platforms WPF UWP Multi-platform targeting

Page 4: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

UI Framework Mortality

What does it mean for a software framework to be dead? There is a big difference between “dead” and “mature”

Windows Forms is not dead But I wouldn’t build any new projects with it

Silverlight is not dead But it is in the trauma unit on life support

Windows Phone is not dead But it has been bloodied on the battlefield and its fate is uncertain

WPF is alive and well

Page 5: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

XAML Platforms

XAML is the past, present, and future of Windows (and other platform) desktop development

Many flavors WPF Silverlight Windows Phone WinRT ( aka Windows Runtime, but not the same thing as Windows RT)

Aka “Windows Store apps” aka “Modern Apps” aka “Metro Apps” 8.1: Universal Apps

Universal Windows Platform (UWP – Windows 10 and up only) Xamarin

iOS, Android, Mac desktop, UWP

Page 6: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Which Should I Care About?

WPF Silverlight Windows Phone WinRT

8.1: Universal Apps

UWP Xamarin

Page 7: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

WPF

Almost a decade old Which means it should be dead several times over compared to other UI

Frameworks

Still the most capable XAML platform Remarkable how mature it was in v1.0

Very few function or capability changes since then A few that were introduced first into Silverlight 4 & 5, then retrofitted into

WPF 4 and 4.5

Page 8: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

WPF Capabilities Missing in other XAML Platforms

Data binding validation Implicit DataTemplates DynamicResources Multi-Bindings A half dozen of so other Binding capabilities

Relative source, Async, update trigger, fallback values, target null value…

DependencyProperty change callbacks Shared Size Groups Full .NET framework capabilities

Page 9: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

WPF Downsides

Windows Desktop only Not as “Touch” friendly out of the box

Third party control suites help

Look a little dated with default styling

Page 10: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Phone Small Tablet2-in-1s

(Tablet or Laptop)Desktops

& All-in-OnesPhablet Large TabletClassic Laptop

Xbox IoTSurface Hub Holographic

Windows 10

Page 11: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Universal Windows Platform (UWP)

XAML for Windows 10 all form factors - Large screen, desktop, mobile, Xbox, IoT, Hololens

Designed for great UX Touch, Pen, or keyboard/mouse

Based on WinRT Relaxes some of the dogmatic design guidance of WinRT and

"Modern Apps" aka "Windows Store Apps" aka "Metro Apps"

Page 12: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Universal Windows Platform (UWP)

Broader capabilities Function as a desktop app or full screen app, participate in Continuum, use

other Win10 platform features

Should be a primary consideration for "desktop" apps if targeting only Windows 10 is not a problem Which it is for most businesses and governments right now

Page 13: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Easy for users to get & stay current

Unified core and app platform

The convergence journey

Windows 10

ConvergedOS kernel

Convergedapp model

Page 14: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Design

Page 15: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Design

Page 16: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features
Page 17: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features
Page 18: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Bridges

• iOS (Islandwood), Android (Astoria), Hosted Web Apps (Westminster), .NET/Win32 apps (Centennial)

• Microsoft play to make it more attractive/easy to migrate from other platforms to Windows 10

• Not the other way around• Astoria - Android Bridge

• Demoed at Build 2015• Wrapper approach to take Android app code and put a wrapper on it so it can be deployed as

a Windows 10 UWP app• Unofficially dead or delayed

• Islandwood• Pull iOS ObjectiveC into Visual Studio and recompile it to be a UWP app• API adapters to integrate with UWP platform features (gaming APIs, UWP lifecycle events,

etc)

Page 19: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Xamarin

• Write your shared mobile app code in C#• Write separate UI presentation code per platformOR:• For simple UI (i.e. static content and non-visualization data centric

apps) – use Xamarin Forms• One UI definition for multiple platforms – in XAML!

• Great integration with Visual Studio• Separate cross-plat Xamarin Studio for consistent experience on Mac

and Windows• Good tooling and great ecosystem

Page 20: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Multi-platform Targeting

• Can I build a XAML app that I can deploy as a WPF app for <Win10 machines, UWP for Windows machines, and Xamarin for mobile apps?

• No

• Can I build a significant portion of my application logic code in a way that can be reused in WPF, UWP, and Xamarin apps

• Absolutely!• Portable Class Libraries (PCLs are the secret sauce)

• Can I reuse any of my XAML across those platforms?• No, not really• Copy/Paste/Tweak reuse of fragments• Different control sets, navigation paradigms, application lifecycles

Page 21: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

What about Single Page Apps?What are they?• Smart/Rich client apps that run in the browser• A replacement for browser plugins (Silverlight, Flash, Java Applets)• Written with HTML/CSS/JavaScript• Based on the modern web (HTML 5, ECMAScript 5,6/2015, CSS 3) and current browser

capabilites (i.e. blazing fast JS execution, rendering that leverages GPU)• Use SPA frameworks

• Examples: Angular (1.x, 2), Aurelia, React, Ember, Knockout, Backbone• UI separation patterns: MVC/MVVM• Have rich data binding• Use dependency injection• Have client navigation (routing) functionality• Assist in making AJAX (Web API) calls

• Same architectural patterns as a well designed XAML desktop app, just different syntax and execution environment

Page 22: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

What about Single Page Apps?What would you choose them?

• Because you get to write your app in JavaScript, baby! • Inherently cross platform on desktop machines

(Windows/Mac/Linux/Mobile)• With responsive design, can work beautifully or at least sufficiently on

mobile web browsers• Can be packaged with Cordova as an installed mobile app from the

app stores (Apple App Store, Google Play, Windows Store)

Page 23: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Break!

Page 24: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

WPF Top Ten(-ish) Power Features

Page 25: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Top Ten-ish Power Features/Tips/Techniques(in presentation order, not importance)

1. Format XAML2. Data binding errors3. Smart converters4. XAML namespaces5. Vector Images

1. Xamalot6. ItemsControl panel customization

a) ListBox templating7. Implicit DataTemplates8. Use MVVM and Leverage a framework

• Prism, MVVM Light, Caliburn Micro, MVVMCross

Page 26: Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Power Features

Copyright © Brian Noyes, All rights reserved

Top Ten-ish Power Features/Tips/Techniques(in presentation order, not importance)

7. Leverage the Designer• Clear Layout, Grid cols/rows• Drag/Drop data binding

8. Leverage Blend• VSM, Behaviors, Animations

9. Behaviors10. Visual State Manager11. Understand and Inspect the Visual Tree12. Shared Size Groups