| title | Loading XAML Control |
|---|---|
| author | nmetulev |
| description | The loading control is for showing an animation with some content when the user should wait in some tasks of the app. |
| keywords | windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, Loading, XAML Control , xaml |
The loading control is for showing an animation with some content when the user should wait in some tasks of the app.
<Page ...
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"/>
<controls:Loading x:Name="LoadingControl" IsLoading="{Binding IsBusy}">
<!-- Loading screen content -->
</controls:Loading>| Property | Type | Description |
|---|---|---|
| IsLoading | bool | Gets or sets a value indicating whether the control is in the loading state |
An example of how we can build the loading control.
BackgroundandOpacityare for the panel who appears and disappears behind our custom control.- Use the
LoadingControlto show specialized content. - You can also use
BorderBrushandBorderThicknessto change theLoadingControl.
<controls:Loading x:Name="LoadingControl" IsLoading="{Binding IsBusy}" >
<StackPanel Orientation="Horizontal" Padding="12">
<Grid Margin="0,0,8,0">
<Image Source="../../Assets/ToolkitLogo.png" Height="50" />
<ProgressRing IsActive="True" Foreground="Blue" />
</Grid>
<TextBlock Text="It's ok, we are working on it :)" Foreground="Black" VerticalAlignment="Center" />
</StackPanel>
</controls:Loading>Finally that the loading control appears, we must set the IsLoading property to true
LoadingControl.IsLoading = true;LoadingControl.IsLoading = trueLoading Sample Page Source. You can see this in action in Windows Community Toolkit Sample App.
Loading XAML File is the XAML template used in the toolkit for the default styling.
| Device family | Universal, 10.0.15063.0 or higher |
|---|---|
| Namespace | Microsoft.Toolkit.Uwp.UI.Controls |
| NuGet package | Microsoft.Toolkit.Uwp.UI.Controls |
