Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger Xamarin.Forms Picker

Can i Trigger a Picker programatically?

I would like a button beside the picker that indicates that the picker is a clickable "dropdown". But how could I open the picker when the button is clicked?

like image 458
Lars Avatar asked Feb 28 '15 17:02

Lars


People also ask

How to use triggers in Xamarin Forms?

Data triggers use data binding to monitor another control to cause the Setter s to get called. Instead of the Property attribute in a property trigger, set the Binding attribute to monitor for the specified value. The example below uses the data binding syntax {Binding Source={x:Reference entry}, Path=Text.

How do you bind a list to picker in xamarin?

When binding to a list of objects, the Picker must be told which property to display from each object. This is achieved by setting the ItemDisplayBinding property to the required property from each object. In the code examples above, the Picker is set to display each Monkey.Name property value.


1 Answers

You can name the picker (e.g. myPicker) and call its Focus event. Do make sure that you're on the main thread at the time you're calling myPicker.Focus()

like image 62
Hutjepower Avatar answered Sep 21 '22 10:09

Hutjepower