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.

Blazor - The New Silverlight?

158 views

Published on

WebAssembly is a new Web Standard for portable code that runs in the browser. Blazor is a Microsoft Project where you can write C# and ASP.NET Core Razor code – making use of WebAssembly. In this session you are invited to start the journey to a new world, a world that can change programming for the Web in the years to come.

Published in: Software
  • Be the first to comment

Blazor - The New Silverlight?

  1. 1. Blazor – The New Silverlight? #THRIVEITCONF
  2. 2. Agenda Intro to WebAssembly Intro to Blazor Creating a Blazor Component
  3. 3. Christian Nagel • Independent Consultant • Training • Coaching • Coding • Writing csharp.christiannagel.com www.cninnovation.com @christiannagel Microsoft MVP
  4. 4. What is Silverlight? • Write .NET Source Code • Runs in a few browsers • Runs on some platforms • Requires Browser-Plug-Ins
  5. 5. INTRO TO WEBASSEMBLY
  6. 6. RUN BINARY CODE IN THE BROWSER
  7. 7. WebAssembly • Wasm Bytecode • Sandboxed environment • Part of the Open Web Platform • https://www.w3.org/TR/wasm-core-1/
  8. 8. WASM 1.0 vs .NET IL • Simpler • Linear memory • No GC • Can't access DOM • JavaScript Interop • MVP (Minimum Viable Product)
  9. 9. Demo Hello, world WebAssembly Demo App
  10. 10. WebAssembly Design Goals Fast Safe Portable • near native code performance • validated, memory-safe, sandboxed • Hardware-independent • Language-independent • Platform-independent
  11. 11. • Image/Video edit • Games • Peer-to-peer apps • Music apps • CAD apps • Local web server • Fat clients • Language interpreters, virtual machines Use Cases
  12. 12. WASM after MVP – In-Progress • Threads • Exception Handling • Garbage Collection • Reference DOM directly • Bulk Memory Operations
  13. 13. INTRO TO BLAZOR
  14. 14. Demo Razor Pages Visual Studio Templates Mono Runtime Dependency Injection
  15. 15. Runtime • Mono runtime built with Wasm • Interpreter, JIT, AOT
  16. 16. Dependency Injection • Framework • Using Microsoft.Extensions.DependencyInjection • BlazorWebAssemblyHost • Registers core services • @inject • Inject services into components
  17. 17. Razor Pages • Blazor UI based on Razor Pages • Razor Pages are new since .NET Core 2.0 • @page directive for routing • Layouts derive from BlazorLayoutComponent
  18. 18. CREATING A COMPONENT
  19. 19. Razor Components • Use it from other components • Like HTML Elements #ThriveITConf
  20. 20. Demo Use a Component Razor Page Inject HttpClient JSON Extensions Binding
  21. 21. What is Silverlight? • Write .NET Source Code • Runs in a few browsers • Runs on some platforms • Requires Browser-Plug-Ins
  22. 22. • Write .NET Source Code • Runs in a few browsers • Runs on some platforms • Requires Browser-Plug-Ins • Write .NET Source Code • Runs in all modern browsers • Runs on many platforms • No Plug-In required What is Silverlight? What is Blazor?
  23. 23. Hosting • Blazor can be hosted in Azure Storage • Azure Functions for the API Backend #ThriveITConf
  24. 24. What's released first? • Razor Components • Part of ASP.NET Core 3.0 #ThriveITConf
  25. 25. .NET WebAssembly Alternatives • Blazor • Browser & Razor • https://blazor.net • Ooui • Xamarin.Forms running in WebAssembly • https://github.com/praeclarum/Ooui/wiki/Xamarin.Forms-with-Web-Assembly • Uno Platform • UWP running in WebAssembly • https://platform.uno/ #ThriveITConf
  26. 26. Summary • WebAssembly is at the beginning • Blazor allows writing .NET Code for the client • Blazor supports all modern browsers • Use your ASP.NET Core knowledge
  27. 27. • It's early! • Try it out • Visual Studio 2019 Preview • .NET Core 2.1 • Blazor Preview • https://blazor.net • https://learn-blazor.com • https://github.com/aspnet/AspNetC ore/tree/master/src/Components • https://csharp.christiannagel.com • https://github.com/cninnovation/thr iveconf For Action
  28. 28. Questions?
  29. 29. #ThriveITConf
  30. 30. THANK YOU! https://www.cninnovation.com https://csharp.christiannagel.com

×