Getting Started with .NET MAUI PullToRefresh
31 Jul 20266 minutes to read
This section guides you through setting up and configuring a PullToRefresh in your .NET MAUI application. Follow the steps below to add a basic PullToRefresh to your project.
Prerequisites
Before proceeding, ensure the following are set up:
- Install .NET 9 SDK or later.
- Set up a .NET MAUI environment with Visual Studio 2022 v17.12 or later.
Step 1: Create a new .NET MAUI project
- Go to File > New > Project and choose the .NET MAUI App template.
- Name the project and choose a location, then click Next.
- Select the .NET framework version and click Create.
Step 2: Install the Syncfusion® MAUI PullToRefresh NuGet package
- In Solution Explorer, right-click the project and choose Manage NuGet Packages.
- Search for Syncfusion.Maui.PullToRefresh and install the latest version.
- Ensure the necessary dependencies are installed correctly and the project is restored. If not, open the Package Manager Console and run
dotnet restore.
Prerequisites
Before proceeding, ensure the following are set up:
- Install .NET 9 SDK or later.
- Set up a .NET MAUI environment with Visual Studio Code.
- Ensure that the .NET MAUI workloads are installed and configured as described here.
Step 1: Create a .NET MAUI project
- Open the command palette by pressing Ctrl+Shift+P and type .NET: New Project, then press Enter.
- Choose the .NET MAUI App template.
- Select the project location, type the project name, and press Enter.
- Then choose Create project.
Step 2: Install the Syncfusion® MAUI PullToRefresh NuGet package
- Press Ctrl+` (backtick) to open the integrated terminal in Visual Studio Code.
- Ensure you are in the project root directory where your
.csprojfile is located. - Run the command
dotnet add package Syncfusion.Maui.PullToRefreshto install the Syncfusion® .NET MAUI PullToRefresh package. - To ensure all dependencies are installed, run
dotnet restore.
Prerequisites
Before proceeding, ensure the following are set up:
- Install .NET 9 SDK or later.
- Set up a .NET MAUI environment with JetBrains Rider 2024.3 or later.
- Make sure the MAUI workloads are installed and configured as described here.
Step 1: Create a new .NET MAUI project
- Go to File > New Solution, select .NET (C#), and choose the .NET MAUI App template.
- Enter the project name, solution name, and location.
- Select the .NET framework version and click Create.
Step 2: Install the Syncfusion® MAUI PullToRefresh NuGet package
- In Solution Explorer, right-click the project and choose Manage NuGet Packages.
- Search for Syncfusion.Maui.PullToRefresh and install the latest version.
- Ensure the necessary dependencies are installed correctly and the project is restored. If not, open the integrated terminal and run
dotnet restore.
The following steps apply to all three IDEs.
Step 3: Register the Syncfusion handler
Make sure to add the namespace.
using Syncfusion.Maui.Core.Hosting;Register the Syncfusion core handler in your CreateMauiApp method of MauiProgram.cs file to use Syncfusion controls.
builder.ConfigureSyncfusionCore();Step 4: Add the PullToRefresh namespace
Add the following namespace in your XAML or C#.
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PullToRefresh;assembly=Syncfusion.Maui.PullToRefresh"using Syncfusion.Maui.PullToRefresh;Step 5: Add the SfPullToRefresh component
The SfPullToRefresh component lets users refresh content with a pull-down gesture. The PullableContent property defines the area where the gesture is recognized. By default, the TransitionMode is SlideOnTop.
<syncfusion:SfPullToRefresh x:Name="pullToRefresh">
<syncfusion:SfPullToRefresh.PullableContent>
<StackLayout>
<Label Text="sample page" />
</StackLayout>
</syncfusion:SfPullToRefresh.PullableContent>
</syncfusion:SfPullToRefresh>public MainPage()
{
InitializeComponent();
this.pullToRefresh.Refreshing += PullToRefresh_Refreshing;
}
private async void PullToRefresh_Refreshing(object? sender, EventArgs e)
{
this.pullToRefresh.IsRefreshing = true;
// Simulate fetching updated data here.
await Task.Delay(2000);
this.pullToRefresh.IsRefreshing = false;
}Handle the Refreshing event to update your data, set IsRefreshing to true while data is being loaded, and back to false when the update completes to dismiss the progress indicator.
For MVVM scenarios, you can also bind IsRefreshing to a boolean property on your ViewModel and toggle it from the Refreshing command.
The following image shows the default SlideOnTop transition behavior:

You can download the PullToRefresh Getting Started sample from GitHub.
To use the Push transition mode instead, set the TransitionMode property as shown below.
<syncfusion:SfPullToRefresh x:Name="pullToRefresh"
TransitionMode="Push"
VerticalOptions="FillAndExpand">
<syncfusion:SfPullToRefresh.PullableContent>
<StackLayout>
<Label Text="sample page" />
</StackLayout>
</syncfusion:SfPullToRefresh.PullableContent>
</syncfusion:SfPullToRefresh>
For details on additional properties such as ProgressColor, PullingThreshold, and RefreshContent, see the Customization page.
Step 6: Run the application
- Select the target platform (Android, iOS, Windows, or macOS) in the IDE run menu.
- Press F5 (Visual Studio / Visual Studio Code) or click Run in JetBrains Rider to build and deploy the app.
- On the page hosting
SfPullToRefresh, swipe down from the top of thePullableContentto trigger a refresh.
Layout considerations
SfPullToRefresh does not render any content of its own, so you must set an explicit size or LayoutOptions when loading it inside a layout. Otherwise, the control will collapse to zero height.