Skip to content

SmallBox loading state #68

@buzz13

Description

@buzz13

I would like to ask if you could add parameter bool Busy to make loading state easy to manage through Task started/finished.

[Parameter]
public bool Busy { get; set; } = false;

@if (LoadingState != LoadingState.None && Busy == true)
    {
        <div class="@(LoadingState.GetDescription<StyleAttribute>())">
            <i class="@LoadingStateIcon @(LoadingStateIconSpinning ? "fa-spin" : "")"></i>
        </div>
    }

Than is easy to manage state

<SmallBox Icon="fas fa-shopping-cart" BackgroundColor="Color.Info" LoadingState="LoadingState.Dark" Busy="IsBusy">

private bool IsBusy { get; set; } = false;

async Task Busy()
{
     IsBusy = true;
 
     //Whatever you want Task to do

     await Task.CompletedTask;
     IsBusy = false;
}

Same applies for cards.

I did it for myself but to help others as well. Also I changed Contet project fontawesome from 5.13.0 to 6.2.0. If you have no time I am going to be happy to send you nuget packages to upload them.

Animation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions