Am trying to load ItemSource of a picker when the picker is focused. But the data is not loaded on 1st focus.
here is the code sample
List<object> itmSrc;
Picker picker = new Picker();
itmSrc = Controls[i].ItemSource;
picker.Focused += BindItemSourceOnFocus;
public void BindItemSourceOnFocus(object sender, FocusEventArgs e)
{
var p = e.VisualElement as Picker;
p.ItemsSource = itmSrc;
}
If any other different approach is possible, let me know.
async
method to load the picker data. Actually, I guess your code is working, but the list you see at the first time is the empty one, that opens 'together' the focus event is being thrown – Diego Rafael Souza