public void DayItemSelectedFunction(DayStructure selectedItem)
 {
     if (null != DayItemSelected)
     {
         DayItemSelected(this, new DaySelectedEventArgs(selectedItem));
     }
 }
        public void Create(DayStructure dayOfMonth, NSIndexPath indexPath, UICollectionView collectionView)
        {
            this.day = dayOfMonth;

            dayView = new DayView(dayOfMonth, frame);
            if (dayOfMonth.isSelected)
            {
                collectionView.SelectItem(indexPath, true, UICollectionViewScrollPosition.CenteredVertically);
            }
            ContentView.AddSubview(dayView);
        }
Example #3
0
        public DayView(DayStructure dayOfMonth, CoreGraphics.CGRect rect)
        {
            this.Frame = rect;
            this.day   = dayOfMonth.Day.Day;

            var dayLabel = getDayLabel(30);

            dayLabel.Layer.CornerRadius  = 15;
            dayLabel.Layer.MasksToBounds = true;
            if (dayOfMonth.isSelected)
            {
                dayLabel.BackgroundColor = UIColor.Red;
                dayLabel.TextColor       = UIColor.White;
                BackgroundColor          = UIColor.White;
            }
            else
            {
                if (dayOfMonth.isWeekend)
                {
                    this.BackgroundColor     = UIColor.FromRGB(245, 245, 245);
                    dayLabel.BackgroundColor = UIColor.FromRGB(245, 245, 245);
                    dayLabel.TextColor       = UIColor.FromRGB(135, 135, 135);
                }
                else
                {
                    if (dayOfMonth.isWorkDay)
                    {
                        BackgroundColor          = UIColor.White;
                        dayLabel.BackgroundColor = UIColor.White;
                        dayLabel.TextColor       = UIColor.Red;
                    }
                    else
                    {
                        BackgroundColor          = UIColor.White;
                        dayLabel.BackgroundColor = UIColor.White;
                        dayLabel.TextColor       = UIColor.FromRGB(195, 195, 195);
                    }
                }
            }
            this.AddSubview(dayLabel);
        }
 public DaySelectedEventArgs(DayStructure _selectedItem)
 {
     SelectedItem = _selectedItem;
 }