/BusyIndicator

BusyIndicator for WPF

Primary LanguageC#MIT LicenseMIT

BusyIndicator

BusyIndicator for WPF with multiple indicator types.

Demo

Indicator Types

Prerequisites:

  • .Net Framework 4.5 or higher
  • .Net Core 3.1 or higher

How to use:

  1. Install the package via NuGet
Install-Package BusyIndicator
  1. Add resources to App.xaml
<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="pack://application:,,,/BusyIndicator;component/BusyMask/BusyMask.xaml"/>
                        <ResourceDictionary Source="pack://application:,,,/BusyIndicator;component/Indicator/Indicator.xaml"/>
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
  1. Add a reference to the library in your view
xmlns:busyIndicator="https://github.com/Peoky/BusyIndicator"
  1. Create a BusyMask on top of main view
<busyindicator:BusyMask x:Name="BusyIndicator" IsBusy="False" IndicatorType="Dashes" BusyContent="Please wait..." >  
         
         
          <... main view goes here ... >
         
         
</busyIndicator:BusyMask>
  1. Set IsBusy property value to true or false or bind it
BusyIndicator.IsBusy = true; or BusyIndicator.IsBusy = false; 

How to change indicator colors:

Indicator colors can be changed now, All you have to do is overriding the colors on your Window, UserControl or even BusyMask resources like below:

    <Window.Resources>
        <SolidColorBrush x:Key="IndicatorForeground" Color="Orange" />
        <SolidColorBrush x:Key="IndicatorBackground" Color="WhiteSmoke" />
    </Window.Resources>

You can also use gradients

<LinearGradientBrush x:Key="IndicatorForeground" StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Offset="1" Color="#eaafc8" />
    <GradientStop Offset="0" Color="#654ea3" />
</LinearGradientBrush>

Hint:

Not all indicators have background, so that change background might not affect all indicators.

If you like this, give it a * please.

Buy Me A Coffee