Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmallBox loading state #68

Open
buzz13 opened this issue Sep 27, 2022 · 0 comments
Open

SmallBox loading state #68

buzz13 opened this issue Sep 27, 2022 · 0 comments

Comments

@buzz13
Copy link

buzz13 commented Sep 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant