# .NET MAUI RefreshView Events

The Telerik UI for .NET MAUI RefreshView raises events while the user pulls the content, when a refresh starts, and when a refresh completes. Handle these events to track the pull progress, cancel a gesture, or load data.

## Pulling

The RefreshView raises the `Pulling` event while the user pulls the content and before a refresh starts. The `Pulling` event handler receives the following parameters:

* The `sender` argument, which is of type `object`, but can be cast to the `RadRefreshView` type.
* A `Telerik.Maui.Controls.RefreshView.RefreshViewPullingEventArgs` object, which provides the following properties:
  * `Progress` (`double`)—Gets the normalized progress toward the refresh threshold, from `0.0` to `1.0`.
  * `Cancel` (`bool`)—Specifies whether to cancel the current pull gesture. After cancellation, the RefreshView continues to handle the gesture.

## Refreshing

The RefreshView raises the `Refreshing` event when a refresh starts. The event also occurs when you start a refresh by setting `IsRefreshing` to `true`. The `Refreshing` event handler receives the following parameters:

* The `sender` argument, which is of type `object`, but can be cast to the `RadRefreshView` type.
* An `EventArgs` object.

Load the data in the `Refreshing` event handler, and then set `IsRefreshing` to `false` to end the refresh.

## Refreshed

The RefreshView raises the `Refreshed` event when a refresh completes. The `Refreshed` event handler receives the following parameters:

* The `sender` argument, which is of type `object`, but can be cast to the `RadRefreshView` type.
* An `EventArgs` object.

## Handle the RefreshView Events

The following example demonstrates how to display the pull progress, cancel a pull gesture after half of the pulling threshold, and log the `Refreshing` and `Refreshed` events.

1. Define the RefreshView in XAML:

   ```XAML
   <telerik:RadRefreshView x:Name="refreshView"
                           Grid.Row="1"
                           Pulling="OnPulling"
                           Refreshing="OnRefreshing"
                           Refreshed="OnRefreshed">
       <VerticalStackLayout Padding="20"
                            Spacing="10"
                            BackgroundColor="#EEEEEE">
           <Label Text="Pull down to raise the Pulling, Refreshing and Refreshed events." />
           <Label x:Name="progressLabel"
                  Text="Progress: 0 %" />
       </VerticalStackLayout>
   </telerik:RadRefreshView>
   ```

2. Define the event handlers:

   ```C#
   private void OnPulling(object sender, RefreshViewPullingEventArgs e)
   {
       this.progressLabel.Text = $"Progress: {e.Progress:P0}";

       if (this.cancelCheckBox.IsChecked == true && e.Progress > 0.5)
       {
           e.Cancel = true;
           this.Log("Pulling canceled");
       }
   }

   private async void OnRefreshing(object sender, EventArgs e)
   {
       this.Log("Refreshing");
       await Task.Delay(1500);
       this.refreshView.IsRefreshing = false;
   }

   private void OnRefreshed(object sender, EventArgs e)
   {
       this.Log("Refreshed");
   }
   ```

> tip For a runnable example demonstrating the RefreshView events, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to the **RefreshView > Events** category.

## See Also

* [RefreshView Commands](https://www.telerik.com/maui-ui/documentation/controls/refreshview/commands)
* [Refresh State](https://www.telerik.com/maui-ui/documentation/controls/refreshview/refresh-state)
* [Thresholds](https://www.telerik.com/maui-ui/documentation/controls/refreshview/thresholds)
