BusyIndicator for WPF with multiple indicator types.
- .Net Framework 4.5 or higher
- .Net Core 3.1 or higher
- Install the package via NuGet
Install-Package BusyIndicator
- 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>
- Add a reference to the library in your view
xmlns:busyIndicator="https://github.com/Peoky/BusyIndicator"
- 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>
- Set
IsBusy
property value totrue
orfalse
or bind it
BusyIndicator.IsBusy = true; or BusyIndicator.IsBusy = false;
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>
Not all indicators have background, so that change background might not affect all indicators.
If you like this, give it a * please.