Ejemplo n.º 1
0
        private void StyleCalendar()
        {
            calendar = new FMCalendar(new CGRect(0, 64, View.Frame.Width, 3 * (View.Frame.Height / 4)), new CGRect(0, 0, View.Frame.Width, 64))
            {
                BackgroundColor  = UIColor.White,
                TodayCircleColor = Util.LightGreen,
                SelectionColor   = Util.Green,
                TintColor        = UIColor.Blue
            };

            var bt = new UIButton(new CGRect(View.Frame.Right - 64, 70, 10, 10));

            bt.SendActionForControlEvents(UIControlEvent.TouchUpInside);
            bt.BackgroundColor = UIColor.Blue;
            View.Add(bt);

            View.Add(calendar);
            calendar.DateSelected += (delegate(DateTime obj) {
                Random r = new Random();
                int rn = r.Next(10);
                if (rn >= 5)
                {
                    DummyData0();
                    Reload();
                }
                else
                {
                    DummyData();
                    Reload0();
                }
            });
        }
Ejemplo n.º 2
0
        public MonthGridView(FMCalendar calendarMonthView, DateTime month)
        {
            _calendarMonthView = calendarMonthView;
            _currentMonth      = month.Date;

            BackgroundColor = _calendarMonthView.MonthBackgroundColor;
            UIFont.FromName("AvenirNextLTPro-Bold", 20);
        }
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            await Task.Delay(100);

            fmCalendar = new FMCalendar(new CGRect(0, 0, View.Frame.Width, View.Frame.Height - 128), new CGRect(0, 0, View.Frame.Width, 80));

            var cover = new UIView(new CGRect(0, 0, View.Frame.Width, 64))
            {
                BackgroundColor = Util.Green
            };

            View.BackgroundColor = Util.BackgroundGrey;

            // Specify selection color
            fmCalendar.SelectionColor = Util.Green;

            // Specify today circle Color
            fmCalendar.TodayCircleColor = Util.Green;

            // Customizing appearance
            fmCalendar.LeftArrow  = UIImage.FromFile("leftArrow.png");
            fmCalendar.RightArrow = UIImage.FromFile("rightArrow.png");

            fmCalendar.MonthFormatString = "MMMM yyyy";

            // Shows Sunday as last day of the week
            fmCalendar.SundayFirst = false;

            // Mark with a dot dates that fulfill the predicate
            fmCalendar.IsDayMarkedDelegate = (date) =>
            {
                return(date.Day % 2 == 0);
            };

            // Turn gray dates that fulfill the predicate
            fmCalendar.IsDateAvailable = (date) =>
            {
                return(date >= DateTime.Today);
            };

            fmCalendar.MonthChanged = (date) =>
            {
                Console.WriteLine("Month changed {0}", date.Date);
            };

            fmCalendar.DateSelected += (date) => {
                Random r  = new Random();
                int    rn = r.Next(10);
                if (rn >= 5)
                {
                    DummyData0();
                    Reload();
                }
                else
                {
                    DummyData();
                    Reload0();
                }
            };

            // Add FMCalendar to SuperView
            fmCalendar.Center = this.View.Center;
            this.View.Add(fmCalendar);
            View.Add(cover);

            StyleTable();
            NavBarStyle();
        }