Shared : Presentation Blazor

The Shared.Presentation.Blazor project provides a reusable Blazor component library built on top of MudBlazor. It includes UI controls for error handling, navigation, forms, tables, loading states, language selection, and reconnection, along with dependency injection helpers and resource files for localization.

Controls : Error Manager

The ErrorManagerControl component inherits from ErrorBoundary and provides centralized error handling for Blazor pages. It cascades itself to child components, catches unhandled exceptions, logs them, and displays error messages via MudBlazor snackbars. In debug mode, it shows the full exception details inline; in release mode, it redirects to an error page.

Controls : Hyperlink Button

The HyperlinkButtonControl component renders a hyperlink styled as a MudBlazor button. It accepts an Href for navigation, an optional HyperlinkButtonType enum that automatically selects the appropriate icon and color (Add, Back, Cancel, Delete, Details, Edit), and a Text parameter for the label.

Controls : Hyperlink Icon

The HyperlinkIconControl component renders a hyperlink as an icon-only button. Similar to the hyperlink button, it uses a HyperlinkIconType enum to automatically resolve the icon and color, and accepts an optional Title for accessibility tooltips.

Controls : Icon Button

The IconButtonControl component renders an icon-only button with an OnClick event callback. It uses an IconButtonType enum to automatically resolve the icon and color (e.g., Delete maps to a red delete icon), and accepts a custom Icon and Title as fallback.

Controls : Language Selector

The LanguageSelectorControl component provides a culture switcher dropdown. It reads supported cultures from LocalizationOption, displays the current culture, and on change either invokes a JS interop call (browser) or navigates to a SetCulture endpoint (server) to apply the new culture with a full page reload.

Controls : Loading

The LoadingControl component renders a loading indicator (e.g., a spinner or progress bar) to signal ongoing asynchronous operations to the user.

Controls : Nav Menu

The navigation menu controls provide the main navigation structure for the Blazor application :
  • NavMenuControl : A container component that renders a navigation menu with a ChildContent render fragment for the menu items.
  • NavLinkControl : A single navigation link component with an Href, an Icon, a Match mode (prefix or all), and a ChildContent for the link label.

Controls : Numeric Field

The NumericFieldControl<T> component renders a numeric input field with support for minimum and maximum value constraints, a label, disabled state, culture-specific formatting, and a custom display format. It binds a generic numeric value with a ValueChanged event callback.

Controls : Paper

The PaperControl component renders a MudBlazor paper surface that wraps its ChildContent in a styled container, providing consistent visual grouping for content sections.

Controls : Reconnect Modal

The ReconnectModalControl component displays a modal dialog when the Blazor SignalR connection is lost, attempting to reconnect. It includes a Razor component, a CSS file for styling, and a JS file for reconnection logic.

Controls : Select

The SelectControl<TItem, TValue> component renders a dropdown select list. It accepts a collection of items, value and text selector functions, and automatically detects whether the value type is nullable to allow clearing the selection.

Controls : Select Enum

The SelectEnumControl<T> component renders a dropdown select list for enum values. It automatically populates the list from the enum's values, detects nullable underlying types, and supports a ValueChanged callback for two-way binding.

Controls : Simple Table

The SimpleTableControl component renders a basic table wrapper that accepts a ChildContent render fragment, providing a consistent styled container for tabular data.

Controls : Text Field

The TextFieldControl<T> component renders a text input field with a label, maximum length validation, disabled state, and configurable number of lines (for multiline text areas). It binds a generic value with a ValueChanged event callback.

Dependency Injection

The ServiceCollectionExtension class provides the AddMudBlazorServices method that registers MudBlazor services with a customized snackbar configuration (top-center position, short transition durations, require interaction to dismiss) and MudBlazor translations.

Extensions : Results

The ToHtmlListExtension class provides an extension method that converts a read-only list of Error objects into an HTML string, joining error messages with <br /> tags for display in Blazor UI.

Resources

The {{Solution.Name}}SharedPresentationBlazorResource class and its associated .resx file provide the default localization resource for shared Blazor presentation strings, used by the IStringLocalizer infrastructure for multilingual support.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.