PM> Install-Package Cloudcrate.AspNetCore.Blazor.Browser.Storage
Check out Steve Sanderson's demo at NDC Minnesota, at minute 48
var serviceProvider = new BrowserServiceProvider(services =>
{
services.AddStorage();
});
@using Cloudcrate.AspNetCore.Blazor.Browser.Storage;
@inject LocalStorage Storage
<input type="text" bind="@value" />
<button onclick="@SetValue">Set</button>
<button onclick="@GetValue">Get</button>
@functions
{
string value;
void SetValue()
{
Storage["Value"] = value;
}
void GetValue()
{
value = Storage["Value"];
}
}