title | page_title | description | slug | tags | published | position |
---|---|---|---|---|---|---|
Getting Started |
Getting Started |
This tutorial will walk you through the creation of a sample application that shows a RadSplashScreen using RadSplashScreenManager. |
radsplashscreen-getting-started |
getting,started,splashscreen,busyindicator |
true |
1 |
This tutorial will walk you through the creation of a sample application that shows a splash screen using RadSplashScreenManager.
To use RadSplashScreen when working with NuGet packages, install the Telerik.Windows.Controls.Navigation.for.Wpf.Xaml
package. The [package name may vary]({%slug nuget-available-packages%}) slightly based on the Telerik dlls set - [Xaml or NoXaml]({%slug xaml-vs-noxaml%})
Read more about NuGet installation in the [Installing UI for WPF from NuGet Package]({%slug nuget-installation%}) article.
tip With the 2025 Q1 release, the Telerik UI for WPF has a new licensing mechanism. You can learn more about it [here]({%slug installing-license-key%}).
If you are not using NuGet packages, you can add a reference to the following assemblies:
- Telerik.Licensing.Runtime
- Telerik.Windows.Controls
- Telerik.Windows.Controls.Navigation
You can find the required assemblies for each control from the suite in the [Controls Dependencies]({%slug installation-installing-controls-dependencies-wpf%}) help article.
To show a splash screen, use the RadSplashScreenManager class. This allows you to display the default RadSplashScreen control or a custom control.
Note that the splash screen window is running on a separate UI thread.
You can start the splash screen anytime you need to indicate that some work is performed. The following example demonstrates how to show it before the MainWindow is loaded. To do this, call the RadSplashScreenManager.Show method. This displays a window hosting a RadSplashScreen control.
{{region radsplashscreen-getting-started-0}} public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var dataContext = (SplashScreenDataContext)RadSplashScreenManager.SplashScreenDataContext; dataContext.ImagePath = "/SplashScreenWPFApplication;component/Images/splashscreen-for-wpf-image.png"; dataContext.Content = "Loading Application"; dataContext.Footer = "This is the footer.";
RadSplashScreenManager.Show();
Thread.Sleep(7000);
RadSplashScreenManager.Close();
base.OnStartup(e);
}
}
{{endregion}}
The splash screen is setup via the RadSplashScreenManager.SplashScreenDataContext object which by default holds an object of type SplashScreenDataContext. Read more about the data context in the [Splash Screen Manager]({%slug radsplashscreen-features-splashscreenmanager%}) article.
This example is using Thread.Sleep
to imitate a loading process, but you can replace this by any code that takes time and notifies you about its actions. Basically, call Show method when you need to display the screen and once your action is completed call the Close method.
To enable the progress bar in RadSplashScreen, set the IsIndeterminate property of SplashScreenDataContext to False. Then you can control the range and current value via the ProgressValue, MinValue and MaxValue properties of the data context. Read more about this in the [Progress Bar]({%slug radsplashscreen-features-progress-bar%}) article.
RadSplashScreenManager can be used to display any UI element. This means that you can create a custom UserControl and pass its type to the Show method. You can also replace the RadSplashScreenManager.SplashScreenDataContext
with a custom object that can be used with the UserControl.
{{region radsplashscreen-getting-started-1}} {{endregion}}
{{region radsplashscreen-getting-started-2}} public class MyUserControlViewModel { public string Text { get; set; } public double Width { get; set; } public double Height { get; set; } } {{endregion}}
{{region radsplashscreen-getting-started-3}} RadSplashScreenManager.SplashScreenDataContext = new MyUserControlViewModel() { Text = "Loading applicaiton...", Width = 150, Height = 150 }; RadSplashScreenManager.Show(); {{endregion}}
The controls from our suite support different themes. You can see how to apply a theme different than the default one in the [Setting a Theme]({%slug styling-apperance-implicit-styles-overview%}) help article.
important Changing the theme using implicit styles will affect all controls that have styles defined in the merged resource dictionaries. This is applicable only for the controls in the scope in which the resources are merged.
To change the theme, you can follow the steps below:
-
Choose between the themes and add reference to the corresponding theme assembly (ex: Telerik.Windows.Themes.Windows8.dll). You can see the different themes applied in the Theming examples from our {% if site.site_name == 'WPF' %}WPF Controls Examples{% else %}Silverlight Controls Examples{% endif %} application.
-
Merge the ResourceDictionaries with the namespace required for the controls that you are using from the theme assembly. For the RadSplashScreen, you will need to merge the following resources:
- Telerik.Windows.Controls
- Telerik.Windows.Controls.Navigation
Example 3 demonstrates how to merge the ResourceDictionaries so that they are applied globally for the entire application.
{{region radsplashscreen-getting-started_7}} <Application.Resources> <ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries> </Application.Resources> {{endregion}}
Alternatively, you can use the theme of the control via the {% if site.site_name == 'WPF' %}StyleManager{% else %}StyleManager{% endif %}.
Figure 1 shows a RadSplashScreen with the Windows8 theme applied.
{% if site.site_name == 'WPF' %}
- Telerik UI for WPF SplashScreen Component
- [Getting Started with Telerik UI for WPF Components]({%slug getting-started-first-steps%})
- [Telerik UI for WPF Installation]({%slug installation-installing-which-file-do-i-need%})
- [Telerik UI for WPF and WinForms Integration]({%slug winforms-integration%})
- [Telerik UI for WPF Visual Studio Templates]({%slug visual-studio-templates%})
- [Setting a Theme with Telerik UI for WPF]({%slug styling-apperance-implicit-styles-overview%})
- Telerik UI for WPF Virtual Classroom (Training Courses for Registered Users)
- Telerik UI for WPF License Agreement {% endif %}
- [Splash Screen Manager]({%slug radsplashscreen-features-splashscreenmanager%})
- [Animations]({%slug radsplashscreen-features-animations%})