LoaderKit.Core 1.0.0

dotnet add package LoaderKit.Core --version 1.0.0
                    
NuGet\Install-Package LoaderKit.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LoaderKit.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LoaderKit.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LoaderKit.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LoaderKit.Core --version 1.0.0
                    
#r "nuget: LoaderKit.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LoaderKit.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LoaderKit.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LoaderKit.Core&version=1.0.0
                    
Install as a Cake Tool

LoaderKit for Windows

Loading indicators described as data and rendered natively with Microsoft.UI.Composition, plus progress indicators drawn with Win2D, for WinUI 3 and the Windows App SDK. Every indicator is a JSON spec shared with the Android and Apple engines, so the same name or spec looks and moves the same on every platform. Full guide with live examples: https://maitrungduc1410.github.io/loader-kit/platforms/windows

Package Contents
LoaderKit.WinUI The LoaderKitIndicator control (net8.0-windows10.0.19041.0, Windows App SDK 1.8+)
LoaderKit.Core Spec model, parser, validation and the reference evaluator (net8.0, netstandard2.0), no UI dependency

Install

dotnet add package LoaderKit.WinUI

LoaderKit.WinUI brings LoaderKit.Core with it. It supports Windows 10 version 1809 (build 17763) and later.

XAML

<Page
    xmlns:lk="using:LoaderKit.WinUI">

    <StackPanel Spacing="16">
        
        <lk:LoaderKitIndicator />

        <lk:LoaderKitIndicator Indicator="BallSpinFadeLoader" Color="DodgerBlue" Width="64" Height="64" />

        <lk:LoaderKitIndicator Indicator="SquareSpin" Speed="0.5" IsAnimating="{x:Bind ViewModel.IsBusy, Mode=OneWay}" />
    </StackPanel>
</Page>

C#

using LoaderKit;
using LoaderKit.WinUI;
using Microsoft.UI;

var indicator = new LoaderKitIndicator
{
    Indicator = "BallPulse",
    Params = new Dictionary<string, double> { ["count"] = 5, ["minScale"] = 0.5 },
    Colors = new[] { Colors.Tomato, Colors.Gold, Colors.MediumSeaGreen },
    Speed = 1.5,
};

indicator.IsAnimating = false;   // freezes; with HidesWhenStopped (default true) it also hides
indicator.CycleProgress = 0.25;  // draws a still frame a quarter into the animation cycle
indicator.CycleProgress = null;  // the clock resumes from where it was

foreach (var name in BuiltinIndicators.Names) Console.WriteLine(name);
Property Default Notes
Indicator "BallPulse" Name of a built-in indicator, see BuiltinIndicators.Names
Spec null A custom spec as JSON; wins over Indicator
IndicatorSpec null A custom LoaderKit.IndicatorSpec; wins over Spec and Indicator
Params null Overrides of the spec params by name; names the spec does not declare are ignored
Color white Color of every element
Colors null Element i uses Colors[i % Colors.Count]; overrides Color
Speed 1 Playback rate; 0 or less pauses. Changing it never makes the animation jump
IsAnimating true Stopping freezes the animation; starting again continues from there
HidesWhenStopped true Draw nothing while stopped
CycleProgress null A point of the animation cycle in [0, 1] to draw instead of animating. It is not the progress of a task: an indicator does not fill up as it goes from 0 to 1
RespectsReduceMotion true When Windows animations are turned off, draw a still frame

Changing Indicator, Spec, IndicatorSpec or Params restarts the animation. Changing colors, speed or size does not. When a spec cannot be used the control draws nothing, sets SpecError and raises SpecFailed; it never throws from a property setter.

Built-in indicators

The 50 indicators of BuiltinIndicators.Names:

Atom AudioEqualizer BallBeat
BallClipRotate BallClipRotateMultiple BallClipRotatePulse
BallDoubleBounce BallFall BallGridBeat
BallGridPulse BallHelix BallHoneycomb
BallMerge BallPulse BallPulseRise
BallPulseSync BallRotate BallRotateChase
BallScale BallScaleMultiple BallScaleRipple
BallScaleRippleMultiple BallSpinFadeLoader BallSquareSpin
BallTrianglePath BallZigZag BallZigZagDeflect
ChasingDots CircleStrokeSpin CubeTransition
JellyBox LineScale LineScaleParty
LineScalePulseOut LineScalePulseOutRapid LineSlide
LineSpinFadeLoader NewtonCradle Orbit
Pacman Radar RunningDots
SemiCircleSpin SquareGridFlip SquareGridWave
SquareSpin Timer TriangleOrbit
TriangleSkewSpin TripleArcSpin

Custom specs

Experimental. Writing your own spec is experimental: until the schema is declared stable, it may change in a minor release. The built-in indicators are not affected, since they ship with the matching engine.

A spec lists elements placed in a unit box, a shape, and tracks that animate element properties over one cycle; several groups of elements can be combined with parts. The schema is documented in SPEC.md.

const string json = """
    {
      "schemaVersion": 1,
      "name": "ThreeBars",
      "duration": 0.9,
      "params": { "low": 0.4 },
      "layout": { "type": "row", "count": 3, "gap": 0.15 },
      "shape": { "type": "line" },
      "stagger": { "each": 0.15 },
      "tracks": [
        { "property": "scaleY", "keyTimes": [0, 0.5, 1], "values": [1, { "$param": "low" }, 1], "easing": "easeInOut" }
      ]
    }
    """;

indicator.Spec = json;

// Or parse it yourself to see every problem at once.
if (!IndicatorSpec.TryParse(json, out var spec, out var errors))
{
    foreach (var error in errors) Debug.WriteLine(error);   // e.g. "tracks[0].keyTimes must be non-decreasing"
}
else
{
    indicator.IndicatorSpec = spec;
}

Specs can also be built in code:

var pulse = new IndicatorSpec("Pulse", duration: 1, new IndicatorPart(new SingleLayout(), new CircleShape())
{
    Tracks = new[]
    {
        new Track(AnimatableProperty.Scale, new double[] { 0, 1 }, new Num[] { 0, 1 }) { Easing = Easing.EaseOut },
        new Track(AnimatableProperty.Opacity, new double[] { 0, 1 }, new Num[] { 1, 0 }),
    },
});

var problems = pulse.Validate();   // empty when valid

// Several groups: element indices, and so colors, continue from one part to the next.
var orbit = new IndicatorSpec("Orbit", duration: 1, new[]
{
    new IndicatorPart(new SingleLayout(Size: 0.3), new CircleShape())
    {
        Tracks = new[] { new Track(AnimatableProperty.Scale, new double[] { 0, 0.5, 1 }, new Num[] { 1, 0.8, 1 }) },
    },
    new IndicatorPart(new SingleLayout(Size: 0.15, Y: 0.1), new CircleShape())
    {
        GroupTracks = new[] { new Track(AnimatableProperty.Rotate, new double[] { 0, 1 }, new Num[] { 0, 2 * Math.PI }) },
    },
});

In XAML, put JSON in a resource or escape the leading brace (Spec="{}{ ... }"), because { starts a markup extension.

Progress

The LoaderKitProgress control shows how much of a task is done: 50 designs across 10 types, with a Value from 0 to 1 or, with null, indeterminate. With Smooth (on by default) it glides to every new value. It draws with Win2D, which LoaderKit.WinUI brings as a dependency. Full guide: https://maitrungduc1410.github.io/loader-kit/guide/progress

<lk:LoaderKitProgress Type="Linear" Variant="Wavy" Value="{x:Bind ViewModel.Progress, Mode=OneWay}" />

<lk:LoaderKitProgress Type="Gauge" Value="0.7" ShowLabel="True" Size="64" />

<lk:LoaderKitProgress Type="Border">
    <Button Content="Upload" />
</lk:LoaderKitProgress>

The child goes in the middle, or inside the stroke of Border. CornerRadius is a property of every control, so the corner radius of the border is ProgressCornerRadius. UI Automation sees a progress bar with a read-only range value in percent.

ResolvedProgress, ProgressGeometry.Commands and ProgressAnimator in LoaderKit.Core turn the options and the time into draw commands, for another renderer.

Without the control

LoaderKit.Core has no UI dependency. Use it to draw indicators with another renderer:

var prepared = new PreparedIndicator(BuiltinIndicators.Get("BallPulse"));
var states = new ElementState[prepared.ElementCount];

prepared.Evaluate(t: 0.3, states);   // positions, sizes, scales, opacity, rotations, trims and group transform
var matrix = ElementTransform.Create(states[0], prepared.Perspective, boxSize: 40);   // group transform included
var shape = prepared.Parts[states[0].Part].Shape;   // the shape with its defaults filled in

IndicatorPlayback implements the shared playback rules (clock, speed, stop, cycle progress, reduce motion).

Building

dotnet test windows/LoaderKit.Core.Tests -c Release   # any OS; runs the shared test vectors
dotnet pack windows/LoaderKit.Core -c Release
dotnet pack windows/LoaderKit.WinUI -c Release        # Windows only

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LoaderKit.Core:

Package Downloads
LoaderKit.WinUI

Loading indicators described as data, rendered with Microsoft.UI.Composition: the LoaderKitIndicator control and the LoaderKitProgress control (50 progress designs drawn with Win2D) for WinUI 3 and the Windows App SDK.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 10/11/2026
1.0.0-rc.2 34 10/9/2026
1.0.0-rc.1 50 10/9/2026
1.0.0-rc.0 42 10/7/2026