Loading Control is used for showing an animation with some content when the user is waiting in between some tasks of the app. Loading Control is from UWP Community Toolkit. The UWP Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10.
Reading this article, you will learn how to use Loading Control in Universal Windows Apps development with XAML and Visual C#.
The following important tools are required for developing the UWP.
- Windows 10 (Recommended)
- Microsoft Visual Studio 2017
- Windows Anniversary Update (10.0.14393.0)
Step 1
Open Visual Studio 2017. Go to Start -> New Project -> select Windows Universal (under Visual C#) -> Blank App (Universal Windows). Now, give a suitable name for your app (UWPLoading) ->OK.
After choosing the target and minimum platform versions that your UWP application will support (Windows Anniversary Update (10.0.14393.0)), the project creates App.xaml and MainPage.xaml.
Step 2
First, update the reference, Microsoft.NETCore.UniversalWindowsPlatform with the latest version of it via "Manage NuGet Packages".
Step 3
Add the following controls in design window for Loading Control View. Add the TextBlock, Button controls, and change the Name and Text properties of those.
Add an image for background in Assets folder
Add the Loading Control and set the Name, and IsLoading properties for Progress Ring Control with image background.
- <Controls:Loading x:Name="LoadPRing" IsLoading="False" Margin="10,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="Azure">
- <StackPanel Orientation="Horizontal" Padding="12">
- <Grid Height="134" Width="134">
- <Image Source="Assets/cscorner.png" Margin="0,10,0,0" />
- <ProgressRing IsActive="True" Foreground="DarkBlue" /> </Grid>
- <TextBlock Text="Loading... Please wait.. :)" Foreground="Black" VerticalAlignment="Center" Height="24" Width="202" /> </StackPanel>
- </Controls:Loading>
Add one more Loading Control and set the Name and IsLoading properties for Progress Bar Control with Image background.
- <Controls:Loading x:Name="LoadPbar" IsLoading="False" Margin="-46,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="Azure">
- <StackPanel Orientation="Horizontal" Padding="12">
- <Grid Height="134" Width="76">
- <Image Source="Assets/cscorner.png" Height="50" Margin="0,42,0,42" />
- <ProgressBar IsIndeterminate="True" Width="200" Foreground="DarkGreen" /> </Grid>
- <TextBlock Text="Loading... Please wait.. :)" Foreground="Black" VerticalAlignment="Center" Height="24" Width="202" /> </StackPanel>
- </Controls:Loading>
Add the following source code to Mainpage.Xaml.cs.



Join the conversation! Your thoughts help the community grow.