private void SetBordersWidth(TKCalendarDayCell cell, int width)
 {
     cell.Style.TopBorderWidth    = width;
     cell.Style.LeftBorderWidth   = width;
     cell.Style.RightBorderWidth  = width;
     cell.Style.BottomBorderWidth = width;
 }
        public override void UpdateVisualsForCell(TKCalendar calendar, TKCalendarCell cell)
        {
            cell.Style.TextColor         = new UIColor(1f, 1f, 1f, 1f);
            cell.Style.BottomBorderWidth = 0;
            cell.Style.TopBorderWidth    = 0;
            cell.Style.TextFont          = UIFont.SystemFontOfSize(10);
            cell.Style.ShapeFill         = new TKSolidFill(new UIColor(1f, 1f, 1f, 1f));

            if (cell.IsKindOfClass(new ObjCRuntime.Class(typeof(TKCalendarDayCell))))
            {
                TKCalendarDayCell dayCell = (TKCalendarDayCell)cell;
                if ((dayCell.State & TKCalendarDayState.Selected) != 0)
                {
                    dayCell.Style.TextColor = new UIColor(0.5f, 0.7f, 0.2f, 1f);
                }
            }

            if (cell.IsKindOfClass(new ObjCRuntime.Class(typeof(TKCalendarDayNameCell))))
            {
                TKCalendarDayNameCell dayNameCell = (TKCalendarDayNameCell)cell;
                dayNameCell.Label.Text = dayNameCell.Label.Text.Substring(0, 1);
            }

            if (cell.IsKindOfClass(new ObjCRuntime.Class(typeof(TKCalendarMonthTitleCell))))
            {
                TKCalendarMonthTitleCell titleCell = (TKCalendarMonthTitleCell)cell;
                titleCell.LayoutMode = TKCalendarMonthTitleCellLayoutMode.MonthWithButtons;
            }
        }
示例#3
0
        public override void UpdateVisualsForCell(TKCalendar calendar, TKCalendarCell cell)
        {
            calendar.Theme            = new TKCalendarIPadTheme();
            calendar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            if (calendar.Presenter is TKCalendarMonthPresenter)
            {
                TKCalendarMonthPresenter presenter = calendar.Presenter as TKCalendarMonthPresenter;
                presenter.Style.DayNameTextEffect = TKCalendarTextEffect.None;
            }

            if (cell is TKCalendarCell)
            {
                TKCalendarDayCell dayCell = cell as TKCalendarDayCell;
                if (dayCell != null)
                {
                    TKCalendarDayState selectedState = TKCalendarDayState.Selected;
                    if ((dayCell.State & TKCalendarDayState.Today) != 0)
                    {
                        cell.Style.TextColor = UIColor.FromRGB(24, 149, 132);
                    }
                    if ((dayCell.State & selectedState) == selectedState)
                    {
                        cell.Style.BackgroundColor = UIColor.FromRGB(184, 184, 184);
                    }
                }
            }
            base.UpdateVisualsForCell(calendar, cell);
        }
        private void SetBordersColor(TKCalendarDayCell cell, Color color)
        {
            var uiColor = color.ToUIColor();

            cell.Style.TopBorderColor    = uiColor;
            cell.Style.LeftBorderColor   = uiColor;
            cell.Style.RightBorderColor  = uiColor;
            cell.Style.BottomBorderColor = uiColor;
        }
示例#5
0
// >> customization-updatevisualcell-cs
        public override void UpdateVisualsForCell(TKCalendar calendar, TKCalendarCell cell)
        {
            if (cell is TKCalendarDayCell)
            {
                TKCalendarDayCell dayCell = (TKCalendarDayCell)cell;
                if ((dayCell.State & TKCalendarDayState.Today) != 0)
                {
                    cell.Style.TextColor = UIColor.Red;
                }
                else
                {
                    cell.Style.TextColor = UIColor.Purple;
                }
            }
        }