<nav class="navbar header-navbar p-0">
    <button class="navbar-toggler bg-primary d-block" @onclick="OnToggleClick">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="ms-3 fw-bold title pe-4">DxBlazorApplication1</div>
</nav>

@code {
    [Parameter] public bool ToggleOn { get; set; }
    [Parameter] public EventCallback<bool> ToggleOnChanged { get; set; }

    async Task OnToggleClick() => await Toggle();

    async Task Toggle(bool? value = null) {
        var newValue = value ?? !ToggleOn;
        if(ToggleOn != newValue) {
            ToggleOn = newValue;
            await ToggleOnChanged.InvokeAsync(ToggleOn);
        }
    }
}