Getting Started

This guide provides the information you need to start using the Telerik UI for .NET MAUI Popup by adding the control to your project.

At the end, you will be able to achieve the following result.

RadPopup

Prerequisites

Before adding the Popup, you need to:

  1. Set up your .NET MAUI application.

  2. Download Telerik UI for .NET MAUI.

  3. Install Telerik UI for .NET MAUI.

Define the Control

  1. When your .NET MAUI application is set up, you are ready to add a Popup control to your page.

    For demonstration purposes, the current scenario demonstrates how to add a sample Popup attached to a Button control. The purpose of the Popup here is to receive user input—it contains the Entry control for allowing the user to enter a comment and a button for closing the popup.

    <Button HorizontalOptions="Center"
      VerticalOptions="Start"
      Text="Add a comment"
      Clicked="ShowPopup">
      <telerikPrimitives:RadPopup.Popup>
          <telerikPrimitives:RadPopup x:Name="popup"
                                      IsModal="True"
                                      OutsideBackgroundColor="#6F000000">
              <telerikMauiControls:RadBorder CornerRadius="8"
                                             BackgroundColor="Wheat">
                  <Grid Padding="20"
                        WidthRequest="200"
                        HeightRequest="100">
                      <Grid.RowDefinitions>
                          <RowDefinition Height="30" />
                          <RowDefinition Height="40" />
                      </Grid.RowDefinitions>
                      <Entry Placeholder="add a note here" />
                      <Button Grid.Row="1"
                          Padding="2"
                          HorizontalOptions="End"
                          Text="Send"
                          Clicked="ClosePopup" />
                  </Grid>
              </telerikMauiControls:RadBorder>
          </telerikPrimitives:RadPopup>
      </telerikPrimitives:RadPopup.Popup>
    </Button>
    
  2. Reference the event handlers.

    private void ClosePopup(object sender, EventArgs e)
    {
    popup.IsOpen = false;
    }
    private void ShowPopup(object sender, EventArgs e)
    {
    popup.IsOpen = true;
    }
    
  3. Add the namespace. Note that the telerikMauiControls namespace is needed by the Border control that is used in the example while it is not required for the Popup to work properly.

    xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.Maui.Controls.Compatibility"
    xmlns:telerikMauiControls="clr-namespace:Telerik.Maui.Controls;assembly=Telerik.Maui.Controls"
    
  4. Register the Telerik controls through the Telerik.Maui.Controls.Compatibility.UseTelerik extension method called inside the CreateMauiApp method of the MauiProgram.cs file of your project:

     using Telerik.Maui.Controls.Compatibility;
    
    public static class MauiProgram
    {
      public static MauiApp CreateMauiApp()
      {
          var builder = MauiApp.CreateBuilder();
          builder
              .UseTelerik()
              .UseMauiApp<App>()
              .ConfigureFonts(fonts =>
              {
                  fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
              });
    
          return builder.Build();
      }
    }           
    

    See Also

In this article
Not finding the help you need?