0
votes

Trying to make a custom control in xamarin forms to handle nullable dates. There seems to be a fair few examples out there which cover iOS and Android but they don't cover UWP as well. I've got it all setup but the problem comes when you have an invisible datePicker and call .focus() on it the datePicker flyout pops up for both iOS and Android but this doesn't work for UWP.

Does anyone know how to open up the UWP DatePicker from code?

1

1 Answers

0
votes

Instead of using invisible DatePicker try using DatePickerFlyout directly. You can instantiate it using its parameterless constructor and then use ShowAtAsync method to display it at a particular location:

var flyout = new DatePickerFlyout();
await flyout.ShowAtAsync(myButton); //show the flyout at a button