Store Data of Your Blazor App in the Local Storage and in the Session Storage

To store local data, today's browsers support a local storage and a session storage. The difference between the two is that the session storage is only available per tab, and the stored data is deleted once you close the tab with the application. The local storage on the other side stores data across sessions. Even when you close the browser and when you re-open it again, the data of the local storage is still there. It will be there as long until you delete it.

So, the difference between the two is how long the data is stored. Beside that, they work exactly the same. Both can store key/value pairs, and those key/value pairs are stored in plain text.

In this blog post, let's look at how to use the local storage and the session storage in your Blazor App.

(more…)
Read more...

Calling WinUI from Blazor App Hosted in WebView2

In the previous blog post you learned how you can use JavaScript Interop to call from your WinUI application into your Blazor application that you host in the WinUI app in a WebView2. So, this was just the direction WinUI to Blazor.

But can you also call from the hosted Blazor app into your WinUI app?

(more…)
Read more...

Hosting a Blazor App in WinUI 3 with WebView2 and call a Blazor Component Method from WinUI

WinUI 3.0 is Microsoft's upcoming UI framework to build modern, native Windows applications.

WinUI is developed open source on https://github.com/microsoft/microsoft-ui-xaml

Last week WinUI 3.0 alpha 2 came out, and Microsoft introduced a WebView2 control that is based on Microsoft Edge Chromium. That means you can run all the modern, awesome web stuff in that WebView2 control if you want.

(more…)
Read more...

Initializing Web Components in Blazor via JS Interop

This blog post shows how to use a simple JavaScript web component in a Blazor app. The web component used here is a friend-list component that takes a friend array. A friend has firstName and lastName and the friend-list component displays the friends in an unordered HTML list.

(more…)
Read more...