示例#1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.ListView> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                return;
            }

            if (e.OldElement != null)
            {
                Control.ItemClick     -= Control_ItemClick;
                Control.ItemLongClick -= Control_ItemLongClick;
                ((NativeDraggableListView)Control).ItemDroppedEvent -= ScrollableListView_ItemDroppedEvent;
            }

            if (e.NewElement != null)
            {
                Items = e.NewElement.ItemsSource as IList;
                NativeDraggableListView scrollableListView = new NativeDraggableListView(Context)
                {
                    GetListCount = ((count) => GetListCount(count))
                };
                scrollableListView.ItemDroppedEvent += ScrollableListView_ItemDroppedEvent;
                scrollableListView.Adapter           = Control.Adapter;

                SetNativeControl(scrollableListView);
                Control.ItemLongClick += Control_ItemLongClick;
                Control.ItemClick     += Control_ItemClick;
            }
        }
 public OnScrollListener(NativeDraggableListView super)
 {
     this.super = super;
 }