Skip to content

Repository files navigation

Smart.Blazor .NET - Blazor support library

NuGet

Features

  • ExtendedAuthorizeRouteView โ€” extended authorize route view for Blazor routing
  • CustomValidator โ€” custom validation component for Blazor forms
  • EditContextExtensions โ€” notify field changes by field name
  • LoadingContainer โ€” render content by loading status
  • Script helper extensions for JavaScript interop

Usage

See Example.BlazorWasm for a runnable Blazor WebAssembly sample of the features below.

EditContextExtensions

editContext.NotifyFieldChanged(nameof(Model.Name));
editContext.NotifyFieldsChanged(nameof(Model.Name), nameof(Model.Email));

LoadingContainer

<LoadingContainer Status="status" Value="items" Context="list">
    <LoadingContent><p>Loading...</p></LoadingContent>
    <FailedContent><p>Failed to load.</p></FailedContent>
    <ChildContent>
        <ListItem Items="list" Context="item">
            <ItemTemplate><li>@item.Name</li></ItemTemplate>
            <EmptyContent><p>No items.</p></EmptyContent>
        </ListItem>
    </ChildContent>
</LoadingContainer>

Status is one of NotLoaded, Loading, Loaded and Failed. ChildContent receives Value when Loaded.

Script helper extensions

await JSRuntime.SetFocus("name");
await JSRuntime.SaveAsFile("report.pdf", "application/pdf", bytes);
await JSRuntime.OpenNewWindow("application/pdf", bytes);
await JSRuntime.HistoryBack();

About

๐Ÿ€ Blazor helpers - authorization-aware routing, custom form validation and JavaScript interop extensions

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages