コード例 #1
0
        private void Initialize()
        {
            this.BackgroundColor = UIColor.Clear;
            this.ClipsToBounds   = true;

            if (DSCalendarTheme.CurrentTheme.MoreViewPosition == DSMoreEventsViewPositon.BottomFull)
            {
                mMoreEventsView = DSCalendarTheme.CurrentTheme.MoreEventsView();

                if (mMoreEventsView != null)
                {
                    this.AddSubview(mMoreEventsView);
                }
            }

            this.SingleTap += () =>
            {
                if (this.Superview != null && this.Superview is DSCalendarCell)
                {
                    ((DSCalendarCell)this.Superview).SingleTouchEvent();
                }
            };
            this.DoubleTap += () =>
            {
                if (this.Superview != null && this.Superview is DSCalendarCell)
                {
                    ((DSCalendarCell)this.Superview).AddNewEvent();
                }
            };
        }
コード例 #2
0
        private void Initialize()
        {
            this.Opaque            = false;
            this.BackgroundColor   = UIColor.Clear;
            this.AutosizesSubviews = true;
            this.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;

            mRightLabel = new UILabel(RectangleF.Empty);
            mRightLabel.BackgroundColor = UIColor.Clear;
            mRightLabel.TextColor       = UIColor.Gray;
            mRightLabel.TextAlignment   = UITextAlignment.Right;
            mRightLabel.Font            = DSCalendarTheme.CurrentTheme.CellTextFont;

            this.AddSubview(mRightLabel);

            mEventView = new DSCalendarEventsView(RectangleF.Empty);
            mEventView.BackgroundColor = UIColor.Clear;
            this.Add(mEventView);

            if (DSCalendarTheme.CurrentTheme.MoreViewPosition == DSMoreEventsViewPositon.TopRight)
            {
                mMoreEventsView = DSCalendarTheme.CurrentTheme.MoreEventsView();

                if (mMoreEventsView != null)
                {
                    this.AddSubview(mMoreEventsView);
                }
            }

            this.SingleTap += () =>
            {
                SingleTouchEvent();
            };

            this.DoubleTap += () =>
            {
                AddNewEvent();
            };
        }