How do I populate a Picker with items in C# code-behind?

Platform: .NET MAUI| Category: Controls

You can populate a Picker with items in C# code-behind using:
C#:

public MainPage()
{
	InitializeComponent();
       var myPicker = new Picker();
       myPicker.ItemsSource = new List<string> {"Mark,Annie,Rose"};        
       Content = myPicker;
}

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.