Weitere ähnliche Inhalte Ähnlich wie Understanding the Windows Desktop App Development Landscape + Top 10 WPF Power Features (20) Kürzlich hochgeladen (20) Understanding the Windows Desktop App Development Landscape + Top 10 WPF Power Features1. Copyright © Brian Noyes, All rights reserved
Windows Desktop Development
Landscape &
WPF Top Ten Power Features
Brian Noyes
CTO and Co-founder, Solliance
brian.noyes@solliance.net, @briannoyes
2. Copyright © Brian Noyes, All rights reserved
About Brian Noyes
CTO and Co-founder, Solliance
www.solliance.net
Microsoft Regional Director
Microsoft MVP
Pluralsight author
www.pluralsight.com
t
e brian.noyes@solliance.net
@briannoyes
http://briannoyes.net
Web API Insider, Windows Azure Insider,
Window Store App Insider, C#/VB Insider
3. Copyright © Brian Noyes, All rights reserved
Agenda
Windows Desktop Development Landscape
UI Frameworks
XAML Platforms
WPF
UWP
Multi-platform targeting
4. 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
5. 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
6. Copyright © Brian Noyes, All rights reserved
Which Should I Care About?
WPF
Silverlight
Windows Phone
WinRT
8.1: Universal Apps
UWP
Xamarin
7. 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
8. 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
9. 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
11. 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"
12. 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
13. Easy for users to get
& stay current
Unified core
and app platform
The convergence journey
Windows 10
Converged
OS kernel
Converged
app model
18. 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)
19. Copyright © Brian Noyes, All rights reserved
Xamarin
• Write your shared mobile app code in C#
• Write separate UI presentation code per platform
OR:
• 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
20. 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
21. 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
22. 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)
25. Copyright © Brian Noyes, All rights reserved
Top Ten-ish Power Features/Tips/Techniques
(in presentation order, not importance)
1. Format XAML
2. Data binding errors
3. Smart converters
4. XAML namespaces
5. Vector Images
1. Xamalot
6. ItemsControl panel customization
a) ListBox templating
7. Implicit DataTemplates
8. Use MVVM and Leverage a framework
• Prism, MVVM Light, Caliburn Micro, MVVMCross
26. 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. Behaviors
10. Visual State Manager
11. Understand and Inspect the Visual Tree
12. Shared Size Groups