Example #1
0
        void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            DialogAdapter dialogAdapter = this.ListAdapter as DialogAdapter;
            Element       elem          = dialogAdapter.ElementAtIndex(e.Position);

            if (elem != null && elem.Click != null)
            {
                elem.Click(sender, e);
            }
        }
        private void Initialize()
        {
            this.ItemClick += (sender, eventArgs) => {
                Element elem = _dialogAdapter.ElementAtIndex(eventArgs.Position);
                if (elem != null && elem.Click != null)
                {
                    elem.Click(sender, eventArgs);
                }
            };

            this.ItemLongClick += (sender, eventArgs) => {
                Element elem = _dialogAdapter.ElementAtIndex(eventArgs.Position);
                if (elem != null && elem.LongClick != null)
                {
                    elem.LongClick(sender, eventArgs);
                }
            };
        }