Quick Start with Telerik UI for .NET MAUI
This article briefly describes the basic steps for using Telerik UI for .NET MAUI in your project. If you are looking for a complete tutorial, see First Steps with UI for .NET MAUI in Visual Studio or First Steps with UI for .NET MAUI in Visual Studio Code instead.
Prerequisites
To create a .NET MAUI project, you need either of the following:
- Visual Studio 2022 17.12 or later with installed .NET MAUI workload.
- Visual Studio Code with the .NET MAUI extension and the .NET and .NET MAUI workloads.
Step 1: Choose the Project Template
Depending on how you start your development with the Telerik UI for .NET MAUI controls, you may need to perform several additional steps to configure the project:
- When using the Telerik UI for .NET MAUI project template provided by the Telerik extensions for Visual Studio or Visual Studio Code, no additional configuration is required and you can start adding Telerik UI for .NET MAUI controls right away.
- When using the default .NET MAUI project template by Microsoft, you must also configure the Telerik namespace, register the Telerik controls, and call the
UseTelerik
extension method as described in Configure the Project below.
Step 2: Configure the Project
If your .NET MAUI project uses the default project template provided by Microsoft, you must perform the steps described in this section manually.
To use the controls in the Telerik UI for .NET MAUI library, add the Telerik namespace:
- In the
MainPage.xaml
file, locate the root element at the top. -
Paste the Telerik namespace below the last already available namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
To visualize the Telerik controls, register them in the MauiProgram.cs
file of your project:
-
In the
MauiProgram.cs
file, add the following using statement:using Telerik.Maui.Controls.Compatibility;
-
In the
CreateMauiApp
method, call theUseTelerik
extension method:<!-- Code omitted for brevity --> .UseMauiApp<App>() .UseTelerik() <!-- Code omitted for brevity -->
If your project uses the
Telerik.UI.for.Maui.8.0.0
NuGet package and .NET 9, you must also install theMicrosoft.Maui.Controls.Compatibility
package. This is needed because Telerik UI for .NET MAUI version 8.0.0 depends on Microsoft's compatibility package, which is no longer included in the default .NET MAUI App project template. This dependency has been removed in Telerik UI for .NET MAUI version 9.0.0.