Blazor

Blazor is a godsend for C# developers who want to build web applications. Here are some of the mistakes I’ve made and things I’ve learned along the way.

Turning a server-side Blazor app into a client-side Blazor app is mostly painless, but CORS errors can get in the way.

How to Build a CORS Proxy for Client-side Blazor

Creating a Babylon component for 3D graphics in Blazor is easy. Being able to compose and manipulate the scene entirely in C# is a bit trickier.

3D Blazor with Babylon

Add interactive slippy maps to your Blazor apps with Leaflet.js. Using IJSObjectReference in .NET 5 makes it much easier to put the pieces together.

Slippy Maps in Blazor with Leaflet

The Geolocation API can only be used via JavaScript. Here’s a Blazor component that wraps all the interop code. Now you can get device position using C# only.

Geolocation in Blazor

Geolocation part 2 tracks when the device’s position changes, C#-ifying the watchPosition function with a .NET callback to raise events.

Geolocation II: Position Updates