public CalendarBlackoutDates()
        {
            //Calendar
            calendar1              = new SFCalendar();
            calendar1.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
            calendar1.HeaderHeight = 40;
            this.AddSubview(calendar1);

            //Setting BlackOutDates
            NSDate     today    = new NSDate();
            NSCalendar calendar = NSCalendar.CurrentCalendar;
            // Get the year, month, day from the date
            NSDateComponents components = calendar.Components(
                NSCalendarUnit.Year | NSCalendarUnit.Month | NSCalendarUnit.Day, today);

            // Set the hour, minute, second

            calendar1.BlackoutDates = new NSMutableArray();

            for (int i = 0; i < 5; i++)
            {
                NSDate startDate = calendar.DateFromComponents(components);
                components.Day += 1;
                calendar1.BlackoutDates.Add(startDate);
            }

            appView = new UITableView();
            appView.RegisterClassForCellReuse(typeof(UITableViewCell), "Cell");
            if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                calendarView.AddSubview(calendar1);
                this.AddSubview(calendarView);
            }
            this.AddSubview(appView);
        }
        public CalendarConfiguration_Mobile()
        {
            //Calendar
            calendar          = new SFCalendar();
            calendar.ViewMode = SFCalendarViewMode.SFCalendarViewModeMonth;
            //	calendar.
            NSMutableArray <NSString> customLabel = new NSMutableArray <NSString>();

            customLabel.Add((NSString)"SUN");
            customLabel.Add((NSString)"MON");
            customLabel.Add((NSString)"TUE");
            customLabel.Add((NSString)"WED");
            customLabel.Add((NSString)"THU");
            customLabel.Add((NSString)"FRI");
            customLabel.Add((NSString)"SAT");
            calendar.CustomDayLabels = customLabel;
            calendar.HeaderHeight    = 40;
            //MonthViewSettings
            SFMonthViewSettings monthSettings = new SFMonthViewSettings();

            monthSettings.WeekDayFontAttribute    = UIFont.FromName("Menlo-Italic", 16f);
            monthSettings.FontAttribute           = UIFont.FromName("Menlo-Regular", 16f);
            monthSettings.HeaderTextColor         = UIColor.White;
            monthSettings.HeaderBackgroundColor   = UIColor.FromRGB(61, 61, 61);
            monthSettings.DayLabelTextColor       = UIColor.White;
            monthSettings.DayLabelBackgroundColor = UIColor.FromRGB(61, 61, 61);
            monthSettings.DateSelectionColor      = UIColor.FromRGB(61, 61, 61);
            monthSettings.DateSelectionTextColor  = UIColor.White;
            calendar.MonthViewSettings            = monthSettings;
            this.optionView();
            this.AddSubview(calendar);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            //// Initialize SfCalendar
            calendar = new SFCalendar();
            calendar.MonthChanged += Calendar_MonthChanged;
            calendar.HeaderHeight  = 0;
            calendar.MonthViewSettings.TodaySelectionBackgroundColor = UIColor.FromRGB(137, 82, 83);

            //// Initialize SfPopUpLayout
            popupLayout = new SfPopupLayout();

            headerContent = new UILabel();
            headerContent.TextAlignment   = UITextAlignment.Center;
            headerContent.BackgroundColor = UIColor.FromRGB(137, 82, 83);
            headerContent.TextColor       = UIColor.White;
            headerContent.Font            = UIFont.FromName("Helvetica-Bold", 16);

            // Adding Header view of the SfPopupLayout
            popupLayout.PopupView.HeaderView      = headerContent;
            popupLayout.PopupView.ShowCloseButton = false;

            // Adding Calendar as ContentView of the SfPopupLayout
            popupLayout.PopupView.ContentView = calendar;

            clearButton = new UIButton();
            clearButton.SetTitle("Clear", UIControlState.Normal);
            clearButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            clearButton.BackgroundColor    = UIColor.Gray;
            clearButton.Frame              = new CGRect(100, 10, 80, 30);
            clearButton.Layer.CornerRadius = 10;
            clearButton.ClipsToBounds      = true;

            okButton = new UIButton();
            okButton.SetTitle("Ok", UIControlState.Normal);
            okButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            okButton.BackgroundColor    = UIColor.Gray;
            okButton.Frame              = new CGRect(190, 10, 80, 30);
            okButton.Layer.CornerRadius = 10;
            okButton.ClipsToBounds      = true;

            clearButton.TouchDown += ClearButton_TouchDown;
            okButton.TouchDown    += OkButton_TouchDown;

            uIStackView      = new UIStackView();
            uIStackView.Axis = UILayoutConstraintAxis.Horizontal;
            uIStackView.UserInteractionEnabled = true;
            uIStackView.Add(clearButton);
            uIStackView.Add(okButton);

            // Adding Footer view of the SfPopupLayout
            popupLayout.PopupView.FooterView = uIStackView;

            rootView = new UIView();
            rootView = GetContentOfPopup();
            this.View.AddSubview(rootView);
        }
 public CalendarLocalization_Mobile()
 {
     calendar              = new SFCalendar();
     calendar.Locale       = new NSLocale("fr-FR");
     calendar.HeaderHeight = 40;
     calendar.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
     this.AddSubview(calendar);
     this.OptionView1();
 }
 public CalendarViews_Mobile()
 {
     calendar              = new SFCalendar();
     calendar.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
     calendar.HeaderHeight = 40;
     //calendar.Appointments = CreateAppointments ();
     this.AddSubview(calendar);
     this.optionView();
 }
Пример #6
0
        public CalendarViews_Tablet()
        {
            //Calendar
            calendar              = new SFCalendar();
            calendar.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
            calendar.HeaderHeight = 40;
            calendarView.AddSubview(calendar);

            this.AddSubview(calendarView);
            this.loadOptionView();
        }
Пример #7
0
        void CreateCalendar()
        {
            m_calendar       = new SFCalendar();
            m_calendar.Frame = m_rect;

            m_calendar.BackgroundColor = UIColor.Clear;
            m_calendar.ViewMode        = SFCalendarViewMode.SFCalendarViewModeMonth;
            m_calendar.HeaderHeight    = 40;

            ViewX = m_calendar;
        }
Пример #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            //// Initialize SfCalendar
            calendar          = new SFCalendar();
            calendar.ViewMode = SFCalendarViewMode.SFCalendarViewModeMonth;

            calendar.DrawMonthCell += CalendarDrawMonthCell;
            this.View.AddSubview(calendar);
        }
        public CalendarLocalization_Tablet()
        {
            //Calendar
            calendar              = new SFCalendar();
            calendar.Locale       = new NSLocale("fr-FR");
            calendar.HeaderHeight = 40;
            calendar.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
            calendarView.AddSubview(calendar);

            this.AddSubview(calendarView);
            this.loadOptionView();
        }
 public CalendarInlineEvents()
 {
     //Calendar
     calendar = new SFCalendar();
     calendar.Appointments = getEnglishAppointments();
     calendar.ViewMode     = SFCalendarViewMode.SFCalendarViewModeMonth;
     calendar.HeaderHeight = 40;
     this.AddSubview(calendar);
     if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
     {
         calendarView.AddSubview(calendar);
         this.AddSubview(calendarView);
     }
 }
Пример #11
0
            public override SFMonthCell DidDrawMonthCell(SFCalendar calendar, SFMonthCell monthCell)
            {
                NSDate          now           = monthCell.Date;
                NSDateFormatter dateFormatter = new NSDateFormatter();

                dateFormatter.DateFormat = "EEEE";
                NSDateFormatter dateFormatter2 = new NSDateFormatter();

                dateFormatter2.DateFormat = "d";
                NSString day     = (NSString)dateFormatter2.ToString(now);
                NSString dayname = (NSString)dateFormatter.ToString(now);

                if (dayname.ToString().Equals("Saturday") || dayname.ToString().Equals("Sunday"))
                {
                    monthCell.TextColor = UIColor.FromRGB(9, 144, 233);
                }
                if (day.ToString().Equals("15") || day.ToString().Equals("24"))
                {
                    UIImageView view = new UIImageView();
                    view.Image     = UIImage.FromBundle("Shop-Closed.png");
                    monthCell.View = view;
                }
                return(monthCell);
            }