How to best support both WPF and UWP, and move from WPF to UWP
Creating Desktop Appswith UWPChristian Nagel@christiannagelwww.cninnovation.com
View Slide
Goals• When & how to use UWP for Data-DrivenBusiness Applications• Moving from WPF to UWP• Introducing important concepts for UWP
Non-Goals• A complete application• UI Styles• Desktop Bridge for UWP• No Crashes (using Visual Studio 2017 RC)
AgendaWPF orUWP?SharingCodeUWPXAMLFeatures
Christian Nagel• Training• Coaching• Consulting• Microsoft MVP• thinktecture• www.cninnovation.com
WPF OR UWP?1
All your usersupgraded toWindows 10!
No
Why not always WPF?• Use New Features• Modern Styling and APIs• Different Devices• Windows 10 uses UWP• Performance
UWP Features• Easy Deployment/Updates• New Controls• Data Sharing• Tile Updates, Notifications
Windows 7 Users• WPF is necessary• Desktop Bridge to add UWP Features forWin10 Users• Write the UI multiple times• Just the UI
SHARING CODE2
Libraries• .NET Libraries only for WPF/.NET Framework• .NET Core Libraries only for .NET Core• Portable Libraries for …• .NET Standard makes sharing easier
MVVM PatternViewView-ModelModelINotifyPropertyChangedINotifyPropertyChangedData Binding, Binding to CommandsXAML
Dependency Injection
What you’ve seen• Portable Libraries• MVVM removes strong dependencies• DI Container makes DI easy
UWP XAML FEATURES3
Assigning Commands
Compiled Binding
Controls
What you’ve seen• AppBar• Compiled Binding• Enhanced TextBox• SplitView• RelativePanel• Adaptive Trigger
Summary• Use MVVM and DI with XAML• Portable / .NET Standard Library• XAML Features
Questions?
More Information (1)• https://docs.microsoft.com• Sample Code:• https://github.com/CNinnovation
More Information (2)• https://github.com/ProfessionalCSharp• https://csharp.christiannagel.com• https://www.cninnovation.com• Training & Coaching
Thank you!
Images Copyright• Decision Time © Steve Woods• Yeah © Redbaron• Sulky angry child © Godfer• Diversity workers © VladimirMucibabic• Injection © Maybe123• Spousal Abuse Humor © KenHurst• Communication © Fantasista• Pilots in the plane © NikolaiSorokin• Bratislava © Tomas1111• http://www.dreamstime.com
www.showit.skwww.gopas.sk