I have a custom picker that inflates a dialoge.
But when you pick an item from the list and then click on the picker again, the list will reappear, giving NO indication over currently picked item.
iOS does this actually, but not android.
This is my android picker dialog:
private void Control_Click(object sender, EventArgs e)
{
//throw new NotImplementedException();
Picker model = Element;
// Element
string[] items = model.Items.ToArray();
AlertDialog.Builder listDialog =
new AlertDialog.Builder(context);
listDialog.SetTitle(model.Title ?? "");
listDialog.SetItems(items, (sender2, args) =>
{
ElementController.SetValueFromRenderer(Picker.SelectedIndexProperty, args.Which);
if (Element != null)
{
if (model.Items.Count > 0 && Element.SelectedIndex >= 0)
Control.Text = model.Items[Element.SelectedIndex];
ElementController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false);
Control?.ClearFocus();
}
listDialog = null;
});
listDialog.SetNegativeButton("Zurück", (s, a) =>
{
ElementController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false);
Control?.ClearFocus();
listDialog = null;
});
listDialog.Show();
}
How would I do this?