Exemple #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <VerticalCalendarListView> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement == null)
            {
                return;
            }

            SetNativeControl(new RecyclerView(this.Context));

            this.Control.HasFixedSize = true;
            this.Control.SetPadding(0, 1, 0, 1);

            LinearLayoutManager manager = new LinearLayoutManager(this.Context, LinearLayoutManager.Vertical, false);

            this.Adapter = new VerticalCalendarListViewAdapter(this.Element, this.Control);

            this.Control.SetLayoutManager(manager);
            this.Control.SetAdapter(this.Adapter);

            this.LayoutManager = manager;

            this.Control.AddOnScrollListener(new VerticalCalendarListViewScrollListener(this.Element, this.LayoutManager, this.Adapter, this.Context));
            this.Element.ScrollToRequested += Element_ScrollToRequested;
        }
Exemple #2
0
            public VerticalCalendarListViewScrollListener(VerticalCalendarListView listView, LinearLayoutManager layoutManager, VerticalCalendarListViewAdapter adapter, Context ctx)
            {
                this.ListView      = listView;
                this.LayoutManager = layoutManager;
                this.Adapter       = adapter;
                this.Context       = ctx;

                this.ListView.Calendar.GetVisibleRows = GetVisibleRows;
            }