BusyIndicator
BusyIndicator copied to clipboard
Busy Indicator for WPF
BusyIndicator
BusyIndicator for Windows Presentation Foundation (WPF)
Prerequisites:
- .Net Framework 4.6+
- .Net Core6+
How to use:
- Install the package via NuGet:
Install-Package BusyIndicators
Note NuGet address is changed!
- Add resource call to App.xaml:
<Application.Resources>
<ResourceDictionary Source="pack://application:,,,/BusyIndicator;component/Theme/Default.xaml"/>
</Application.Resources>
- Add a reference to the library:
xmlns:busyIndicator="https://github.com/moh3ngolshani/BusyIndicator"
- Create a BusyMask on top of main view:
<busyIndicator:BusyMask x:Name="BusyIndicator"
IsBusy="False"
IndicatorType="Dashes"
BusyContent="Please wait..."
BusyContentMargin="0,20,0,0"
IsBusyAtStartup="False" >
<... main view goes here...>
</busyIndicator:BusyMask>
- Bind or Set
IsBusyproperty.
How to change indicator sizes:
Indicator sizes can be changed now:
- Add a reference to the mscorlib assembly:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
- Override the
IndicatorScaleX&IndicatorScaleY:
<Window.Resources>
<sys:Double x:Key="IndicatorScaleX" >2</sys:Double>
<sys:Double x:Key="IndicatorScaleY" >2</sys:Double>
</Window.Resources>
How to change indicator colors:
Override the IndicatorForeground & IndicatorBackground:
<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 changing the
IndicatorBackgroundmight not affect all indicators.
If you like this, give it a * please.
