Coder Social home page Coder Social logo

blazorprogressindicator's Introduction

Blazor.LoadingIndicator

Simple to use loading indicator for Microsoft ASP.NET Core Blazor

Demo

Why I created this

Sometimes you need to retrieve data from a (slow) server, or sort a huge amount of data. Of course you can just show nothing while loading, or build something yourself that shows a some sort of spinner while the work is being done.

However, copying the same pieces of code to several pages and sometimes to multiple widgets on one page kept annoying me. Thus I decided to create this library to make it a little more easy.

How to use

Take a look at the code of the two sample projects.

The simple example utilizes the built-in template while the more complex example shows how to use multiple templates (even on one page).

License

This library is released under the GNU LGPLv3 license.

blazorprogressindicator's People

Contributors

dependabot-preview[bot] avatar h3x4d3c1m4l avatar mumby0168 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blazorprogressindicator's Issues

Can't find AddLoadingIndicator

I'm using Blazor with .NET Core 3.1
installed the nuget package:

"H3x.Blazor.LoadingIndicator" Version="0.2.8-preview.7"

on Startup.cs I got:

using Blazor.LoadingIndicator

but AddLoadingIndicator don't work:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS1061	'IServiceCollection' does not contain a definition for 'AddLoadingIndicator' and no accessible extension method 'AddLoadingIndicator' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)	MI.UserManager	C:\Projects\mi-usermanager\Startup.cs	25	Active

Consider retargeting for LGPL

Currently the library is under the GPL license, this can be a problem in a lot of projects.

For only a library all the source code must be public. Using LGPL allows anyone to use it as a library, but cannot include directly the source code in other applications.

using in non async method

How can I use it in the non-async method? My function is non-async but I call the async method inside like xxxxxx.ConfigureAwait(false).GetAwaiter().GetResult().
Do we have a chance to do it?

NuGet Package does not work on Blazor WASM project

I installed the Nuget Package, but I seem to be unable to get it working.

Steps to reproduce:

  • Install latest: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.2.0-preview1.20073.1
  • Install the Nuget package
  • (Close and re-open solution, rebuild, clean, and all)
  • Add package namespace to _imports.razor

image

Seems not to be working with Blazor ServerSide

I have implemented this loading indicator in a service side blazor application. The texts of the defaulttemplate is shown but the loading indicator (spinner) is not visible. There background div is also not visible. Is there a solution for this? I am currently migrating to Blazor ClientSide but this is still beta.

Add example of initial app loading screen

The default Blazor app template just shows "Loading" while the browser is still downloading and parsing the framework and app files. Although it is not possible to make it more fancy using this library, it can be made much more fancy without much code.

This repo should, for the sake of completeness, come with a sample to show how that can be done.

ArgumentNullException: Value cannot be null. (Parameter 'key')

Hi,

I create a new Blazor Server Project and i want use your loading component. But, when i tries this, i have an internal server error :

ArgumentNullException: Value cannot be null. (Parameter 'key')
    System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.ThrowKeyNullException()
    System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.TryGetValue(TKey key, out TValue value)
    Blazor.LoadingIndicator.Loading.UnsubscribeFromTaskProgressChanged(string context, Action<ITaskStatus> action)
    Blazor.LoadingIndicator.Indicator.Dispose()
    Microsoft.AspNetCore.Components.Rendering.ComponentState.Dispose()
    Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose(bool disposing)
    Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.HandleException(Exception exception)
    Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose(bool disposing)
    Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose()
    Microsoft.AspNetCore.Mvc.ViewFeatures.RazorComponents.StaticComponentRenderer.PrerenderComponentAsync(ParameterView parameters, HttpContext httpContext, Type componentType)
    Microsoft.AspNetCore.Mvc.Rendering.HtmlHelperComponentExtensions.PrerenderedServerComponentAsync(HttpContext context, ServerComponentInvocationSequence invocationId, Type type, ParameterView parametersCollection)
    Microsoft.AspNetCore.Mvc.Rendering.HtmlHelperComponentExtensions.RenderComponentAsync<TComponent>(IHtmlHelper htmlHelper, RenderMode renderMode, object parameters)
    Search_Blazor.Pages.Pages__Host.<ExecuteAsync>b__15_1() in _Host.cshtml

            @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))

I just copy your sample :
@using Blazor.LoadingIndicator

Add :

<Indicator Context="on-init">
        <p>I'm successfully initialized!</p>
   </Indicator>

And :

protected` override async Task OnInitializedAsync()
    {
        await Loading.StartTaskAsync(async (task) =>
        {
            await Task.Delay(5000);
        }, "on-init", "Initializing", "Please wait ...");
    
    }

What's wrong ? Your component can be use in blazor server template ?

Have a good day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.