Events in Xamarin Picker (SfPicker)

4 Aug 20223 minutes to read

Three events have been used for a picker when it is in the Dialog mode. They are,

Opened event

The Opened event occurs when the picker is opened.

Closing event

The Closing event raises when the picker gets closing. You can stop the picker close action by setting the e.cancel to true.

Closed event

The Closed event was raised after the picker is closed.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns=""
                         <syncfusion:SfPicker Opened="picker_Opened" Closed="picker_Closed" Closing="picker_Closing">

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace PickerClosingEventSample
   public partial class MainPage : ContentPage    
        SfPicker picker = new SfPicker();

        public MainPage()
         picker.Opened += picker_Opened;
         picker.Closing += picker_Closing;
         picker.Closed += picker_Closed;


        private void picker_Opened(object sender, EventArgs e)
          // handle the open action

        private void Picker_Closing(object sender, Syncfusion.XForms.Core.CancelEventArgs e)
           // stop the close action by setting the `e.cancel` to true.

        private void picker_Closed(object sender, EventArgs e)
           // hit after the picker is closed.


View sample in GitHub


You can refer to our Xamarin Picker feature tour page for its groundbreaking feature representations. You can also explore our Xamarin.Forms Picker example to knows the functionalities of each feature.