Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Desktop Bridge with WPF - One way to build modern apps with WPF

264 views

Published on

Advantages of the Universal Windows Platform, MVVM and DI, using the desktop bridge, XAML islands, .NET Core 3.0 with WPF

Published in: Software
  • Be the first to comment

  • Be the first to like this

Desktop Bridge with WPF - One way to build modern apps with WPF

  1. 1. Desktop Bridge – Ein Weg von WPF zu modernen Apps @christiannagel
  2. 2. Agenda Warum UWP? MVVM & DI Desktop Bridge The next big thing
  3. 3. Christian Nagel • Training • Coaching • Consulting • Development • Microsoft MVP • www.cninnovation.com • csharp.christiannagel.com
  4. 4. Warum UWP?
  5. 5. Universal Windows Platform • Neue Features • Controls, Compiled Binding • Modernes User Interface • Built-in Animations, Fluent Design • Plattformen • Desktop, Mobile, HoloLens, Xbox One • Installation mit Windows App Store, Sideloading, Web Install • Compiles to native code • Verwendet von Windows 10 Settings, Apps…
  6. 6. UWP - Modern Controls • NavigationView • RelativePanel • Hub • Flip View Layout • TextBox mit Header • CommandBar/AppBar • Inking • AutoSuggest Elements and Lists
  7. 7. UWP – Compiled Binding Compiler Errors Schneller (ohne Reflection) Kein DataContext
  8. 8. MVVM & DI
  9. 9. MVVM Pattern View View-Model Model
  10. 10. Dependency Injection • Einfache View-Models • Services unabhängig von View-Models • Services über DI injecten • Unabhängigkeit von Plattform-Features • Dependency Injection Container erleichtern Dependency Management
  11. 11. Shared Sources • UI Technologies • WPF • UWP • Xamarin • Common Services in .NET Standard Libraries • Platform Specific Services
  12. 12. Desktop Bridge
  13. 13. Desktop Bridge • Nutzen von UWP Features in WPF • Reuse von bestehenden Desktop Applikationen • Windows 10 Build 14393 oder neuer • Installation über Windows Store oder Sideloading
  14. 14. Demo • Create App Package • Show Package • Use Windows APIs • Launch UWP App
  15. 15. Process zur Desktop Bridge •APPX Package Desktop App Converter •Viele APIs nicht verfügbar Enhance with Windows 10 •Kommunikation via App Services UWP App Twin
  16. 16. The next big thing(s)
  17. 17. 1. Windows Compatibility Pack • Windows Compatibility Pack for .NET Core 2.1 • .NET Core 2.0 has been enhanced with thousands APIs • Add more for Windows • Microsoft.Win32.Registry • System.CodeDom • System.Configuration.Conf igurationManager • System.Data.SqlClient • System.Drawing • System.ServiceProcess • System.ServiceModel • …
  18. 18. 2. UWP Controls in a Library Bisher • Controls Teil der Windows Runtime • Neue Controls mit Windows Runtime Updates • Warten für User Updates Neu • Windows UI Library • Windows Controls Open Source • Controls können sofort verwendet werden • Verfügbar für ältere Windows 10 Versionen https://github.com/Microsoft/microsoft-ui-xaml
  19. 19. 3. Host UWP Controls in WPF Apps Microsoft Toolkit • InkCanvas / InkToolbar • MediaPlayerElement • WebView • WindowsXamlHost https://github.com/Microsoft/WindowsCommunityToolkit
  20. 20. XAML Island Architecture UWP XAML Control XAML Bridge Source WinRT API HWND WPF XAML Host WinForms XAML Host Control Wrappers Custom Controls
  21. 21. Limitations • HWND Airspace • Tooling • Multiple top level Windows run on different threads • Accessibility • Accelerator keys • x:Bind needs .NET Standard Library • no Reveal fluent effect • Hosting custom user controls • Inline ink with Input Controls • …
  22. 22. 4. .NET Core 3.0 & WPF Supports Windows Forms und WPF XAML Islands XAML Controls Access to all Windows 10 APIs .NET Core App Bundler
  23. 23. Is your WPF App ready? • .NET Core 3.0 API Desktop Analyzer • https://blogs.msdn.microsoft.com/ dotnet/2018/08/08/are-your- windows-forms-and-wpf- applications-ready-for-net-core-3- 0/
  24. 24. Why Desktop on .NET Core? Side-by-side Machine global or app local Core runtime and API improvements New .csproj
  25. 25. MSIX – Das neue InstallationsPaket • Containerization MSI APPX MSIX
  26. 26. Install .NET Core 3.0 (Alpha) https://github.com/dotnet/core-sdk
  27. 27. Actions WPF oder UWP Desktop Bridge XAML Controls in WPF WPF mit .NET Core 3.0 Migrate to UWP over time
  28. 28. Decisions – Desktop App Legacy WPF? MVVM & DI Arch? Y Y Create UWP App N N Window 10 soon? Use Desktop Bridge Y N Wait for .NET Core 3.0 Advanced Features? Use Microsoft Toolkit Y N
  29. 29. Alternative (1) – Desktop App Legacy WPF? MVVM & DI Arch? Y Y Create UWP App N N Convert to MVVM & DI Y N Create Xamarin App
  30. 30. Alternative (2) – Desktop App Legacy WPF? Y Create new HTML App N
  31. 31. Questions?
  32. 32. More Information • https://github.com/ProfessionalCSharp • https://csharp.christiannagel.com • https://www.cninnovation.com • Training & Coaching
  33. 33. Thank you!

×