Usage
The static
class contains default settings which can override the default settings for MudBlazor components.The following example changes all components to use a large size, secondary color, and filled variant as their defaults.
Note: Defaults should be set when your application initializes, such as when adding MudBlazor services.
// Add MudBlazor services Services.AddMudServices(); // Change the default appearance of all MudButton components MudGlobal.ButtonDefaults.Color = Color.Secondary; MudGlobal.ButtonDefaults.Size = Size.Large; MudGlobal.ButtonDefaults.Variant = Variant.Filled;
Exception Handler
A global exception handler is available via the MudGlobal.UnhandledExceptionHandler
property.
// Add MudBlazor services Services.AddMudServices(); // Send all exceptions to the console MudGlobal.UnhandledExceptionHandler = (exception) => Console.WriteLine(exception);