private static void AdapterViewSelectedItemPositionChanged(AdapterView sender, AttachedMemberChangedEventArgs <int> args) { if (sender.GetBindingMemberValue(AttachedMembers.AdapterView.ScrollToSelectedItem).GetValueOrDefault(true) || sender is Spinner) { sender.SetSelection(args.NewValue); } var adapter = GetAdapter(sender) as IItemsSourceAdapter; if (adapter != null) { sender.SetBindingMemberValue(AttachedMembers.AdapterView.SelectedItem, adapter.GetRawItem(args.NewValue)); } }
private static void AdapterViewSelectedItemPositionChanged(AdapterView sender, AttachedMemberChangedEventArgs <int> args) { if (!(sender is ListView) || ScrollToSelectedItemMember.GetValue(sender, null)) { sender.SetSelection(args.NewValue); } var adapter = GetAdapter(sender) as ItemsSourceAdapter; if (adapter == null) { return; } object item = adapter.GetRawItem(args.NewValue); AdapterViewSelectedItemMember.SetValue(sender, item); }
public void OnItemSelected(AdapterView parent, View view, int position, long id) { var selected_title = string.Format("{0}", parent.GetItemAtPosition(position)); Log.Debug(TAG, "OnItemSelected: " + selected_title); if (ignore_keyset_count > 0) { Log.Debug(TAG, "Ignoring item selection"); ignore_keyset_count--; return; } foreach (var item in skuDetails) { if (item.Title.Contains(selected_title)) { LaunchBilling(item, parent_activity); parent.SetSelection(0); return; } } }