public override Android.Views.View GetView(int position, Android.Views.View convertView, ViewGroup parent)
        {
            var monthView = (MonthView)convertView ??
                            MonthView.Create(parent, _inflater, _calendar.WeekdayNameFormat, _calendar.Today,
                                             _calendar.ClickHandler);

            monthView.Init(_calendar.Months[position], _calendar.Cells[position]);
            return(monthView);
        }
示例#2
0
        public override void DestroyItem(Android.Views.View container, int position, Java.Lang.Object @object)
        {
            //activePickerViews[position].OnDateSelected -= HandleOnDateSelected;
            //activePickerViews.Remove(position);
            var monthView = @object.JavaCast <MonthView>();

            (container.JavaCast <Android.Support.V4.View.ViewPager>()).RemoveView(monthView);
            _reusableMonthView = monthView;
            _activeMonthViews.Remove(position);
        }
示例#3
0
        public override Java.Lang.Object InstantiateItem(Android.Views.View container, int position)
        {
            Java.Lang.Object obj = container;
            var       pager      = obj.JavaCast <Android.Support.V4.View.ViewPager>();
            MonthView monthView  = null;

            if (_reusableMonthView == null)
            {
                monthView = MonthView.Create(pager, _inflater, _calendar.WeekdayNameFormat, _calendar.Today,
                                             _calendar.ClickHandler);
            }
            else
            {
                monthView          = _reusableMonthView;
                _reusableMonthView = null;
            }
            monthView.Init(_calendar.Months[position], _calendar.Cells[position]);
            //monthView.SetBackgroundColor(global::Android.Graphics.Color.Orange);

            pager.AddView(monthView);
            _activeMonthViews[position] = monthView;
            return(monthView);
        }