Skip to content

Display dynamic effects during time-consuming operation. Currently, it contains circular and linear loading bars. Related blog post: "WPF control library-imitating the progress bar of Windows 10"

cs
public abstract class LoadingBase : ContentControl
cs
public class LoadingLine : LoadingBase
cs
public class LoadingCircle : LoadingBase

LoadingBase attribute

PropertyDescriptionDefault ValueRemarks
IsRunningIs it currently loadingtrue
DotCountNumber of Dots5
DotIntervalDot Interval10
DotBorderBrushDot border color
DotBorderThicknessDot border thickness0
DotDiameterDot radius6
DotSpeedThe time taken for one cycle4s
DotDelayTimeAnimation delay of each point80ms

LoadingCircle property

PropertyDescriptionDefault ValueRemarks
DotOffSetDot Offset20
NeedHiddenDoes the dot need to be hidden in the middle of the movementtrue

Styles

Style for LoadingLineStyle for LoadingCircle
LoadingLineLargeLoadingCircleLarge
LoadingLineLargeLightLoadingCircleLargeLight
LoadingLineLightLoadingCircleLight

Case

xml
<StackPanel Width="600" Margin="32" VerticalAlignment="Center">
    <hc:LoadingLine/>
    <hc:LoadingLine Margin="0,30" Foreground="BlueViolet" Style="{StaticResource LoadingLineLarge}"/>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
        <hc:LoadingCircle/>
        <Border VerticalAlignment="Center" Margin="32,0,0,0" Background="{DynamicResource PrimaryBrush}" CornerRadius="10">
            <hc:LoadingCircle Style="{StaticResource LoadingCircleLight}" Margin="10"/>
        </Border>
    </StackPanel>
</StackPanel>

Loading

Released under the MIT License.