havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
475 stars 66 forks source link

Pass HxMessageBox Settings (ButtonSettings ) to it? #788

Closed chobo2 closed 4 months ago

chobo2 commented 4 months ago

Hi

I am using

public class AppButtonSettings
{
    public static ButtonSettings MainButton { get; } = new()
    {
        Color = ThemeColor.Primary,
        Icon = BootstrapIcon.Fullscreen
    };

    public static ButtonSettings SecondaryButton { get; } = new()
    {
        Color = ThemeColor.Secondary,
        Outline = true
    };

    public static ButtonSettings CloseButton { get; } = new()
    {
        Color = ThemeColor.Danger,
        Outline = true,
        Icon = BootstrapIcon.XLg
    };
}

I want to send my customizations to the HxMessageBox to get the same styling across those buttons as well, but there seems to be no way to do this.

crdo commented 4 months ago

@chobo2 that is what PrimaryButtonSettings and SecondaryButtonSettings on HxMessageBox is for.

chobo2 commented 4 months ago

@chobo2 that is what PrimaryButtonSettings and SecondaryButtonSettings on HxMessageBox is for.

I did see that, but I am unclear where to set that.

hakenr commented 4 months ago
HxMessageBox.Defaults.PrimaryButtonSettings = AppButtonSettings.MainButton;
HxMessageBox.Defaults.SecondaryButtonSettings = AppButtonSettings.SecondaryButton;