Esempio n. 1
0
        public CalendarDatesPage()
        {
            InitializeComponent();

            Color primaryColor   = (Color)Application.Current.Resources["PrimaryColor"];
            Color mainWhiteColor = (Color)Application.Current.Resources["MainWhiteColor"];
            Color mainBlackColor = (Color)Application.Current.Resources["MainBlackColor"];
            Color mainGrayColor  = (Color)Application.Current.Resources["MainGrayColor"];

            MonthLabelSettings labelSettings = new MonthLabelSettings();

            labelSettings.DayFormat     = "EEE";
            labelSettings.DayLabelSize  = 20;
            labelSettings.DateFormat    = "dd";
            labelSettings.DateLabelSize = 20;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.HeaderTextColor              = mainBlackColor;
            monthViewSettings.HeaderBackgroundColor        = mainGrayColor;
            monthViewSettings.DayHeaderTextColor           = mainBlackColor;
            monthViewSettings.DayHeaderBackgroundColor     = mainWhiteColor;
            monthViewSettings.PreviousMonthBackgroundColor = mainBlackColor;
            monthViewSettings.TodayTextColor              = primaryColor;
            monthViewSettings.DateSelectionColor          = primaryColor;
            monthViewSettings.SelectedDayTextColor        = mainWhiteColor;
            monthViewSettings.CurrentMonthTextColor       = mainWhiteColor;
            monthViewSettings.CurrentMonthBackgroundColor = mainBlackColor;
            monthViewSettings.WeekEndTextColor            = mainWhiteColor;
            monthViewSettings.InlineTextColor             = mainWhiteColor;
            monthViewSettings.InlineBackgroundColor       = primaryColor;
            monthViewSettings.MonthLabelSettings          = labelSettings;
            Calendar.MonthViewSettings = monthViewSettings;

            PopulateCalendar();
        }
        //void OnSizeChanged(object sender, EventArgs e)
        //{
        //}

        void sampleSettings()
        {
            width = Core.SampleBrowser.ScreenWidth;
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#F5F5F5");
            monthSettings.DateSelectionColor    = Color.FromHex("#E0E0E0");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            cal.MonthViewSettings = monthSettings;
            if (Device.OS == TargetPlatform.Android)
            {
                cal.HeaderHeight = 50;
            }
            else if (Device.OS == TargetPlatform.Windows)
            {
                cal.HeaderHeight = 50;
            }
            if (Device.Idiom == TargetIdiom.Tablet)
            {
                width /= 2;
            }

            if (Device.OS == TargetPlatform.iOS)
            {
                cal.HeaderHeight = 40;
                if (Device.Idiom == TargetIdiom.Tablet)
                {
                    this.Padding = new Thickness(-20);
                }
            }
            this.Padding = new Thickness(-10);
        }
Esempio n. 3
0
        public override View GetSampleContent(Context context1)
        {
            context = context1;
            InizialMethod();

            //calendar
            calendar = new SfCalendar(context);
            calendar.ShowEventsInline = false;
            calendar.HeaderHeight     = 100;
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting  = labelSettings;
            monthViewSettings.TodayTextColor         = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor  = Color.ParseColor("#E4E8ED");
            monthViewSettings.WeekDayBackgroundColor = Color.ParseColor("#F7F7F7");
            calendar.MonthViewSettings = monthViewSettings;
            mainLayout.AddView(calendar);

            OptionMainView();

            return(frame);
        }
Esempio n. 4
0
        public override View GetSampleContent(Context context1)
        {
            context = context1;
            InitialMethod(context);

            //calendar
            calendar = new SfCalendar(context);
            calendar.ShowEventsInline = false;
            calendar.ViewMode         = ViewMode.MonthView;
            calendar.HeaderHeight     = 100;
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting        = labelSettings;
            monthViewSettings.TodayTextColor               = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor        = Color.ParseColor("#E4E8ED");
            monthViewSettings.CurrentMonthTextColor        = (Color.ParseColor("#F7F7F7"));
            monthViewSettings.WeekDayBackgroundColor       = Color.ParseColor("#464646");
            monthViewSettings.WeekDayTextColor             = Color.ParseColor("#F9F9F9");
            monthViewSettings.PreviousMonthTextColor       = Color.ParseColor("#BFBFBF");
            monthViewSettings.PreviousMonthBackgroundColor = Color.ParseColor("#F9F9F9");
            calendar.MonthViewSettings = monthViewSettings;
            calendar.DrawMonthCell    += calendar_DrawMonthCell;
            mainLayout.AddView(calendar);

            OptionMainView(context);

            return(frame);
        }
Esempio n. 5
0
        private void SetMonthSettings()
        {
            monthSettings = new MonthViewSettings();

            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
            schedule.MonthViewSettings  = monthSettings;
            monthSettings.BlackoutDates = new NSMutableArray();
            if (switchBlackOutDates != null && switchBlackOutDates.On)
            {
                components.Day -= 3;
                for (int i = 0; i < 3; i++)
                {
                    NSDate startDate = calendar.DateFromComponents(components);
                    components.Day += 1;
                    schedule.MonthViewSettings.BlackoutDates.Add(startDate);
                }
            }

            if (switchWeekNumber != null && switchWeekNumber.On)
            {
                schedule.MonthViewSettings.ShowWeekNumber = true;
            }
            else
            {
                schedule.MonthViewSettings.ShowWeekNumber = false;
            }
        }
Esempio n. 6
0
        public override View GetSampleContent(Context context)
        {
            //mainLayout
            mainLayout                = new FrameLayout(context);
            calendar                  = new SfCalendar(context);
            calendar.ViewMode         = ViewMode.MonthView;
            calendar.HeaderHeight     = 100;
            calendar.ShowEventsInline = false;
            calendar.Locale           = new Java.Util.Locale("zh", "CN");
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting  = labelSettings;
            monthViewSettings.SelectedDayTextColor   = Color.Black;
            monthViewSettings.TodayTextColor         = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor  = Color.ParseColor("#E4E8ED");
            monthViewSettings.WeekDayBackgroundColor = Color.ParseColor("#F7F7F7");
            calendar.MonthViewSettings = monthViewSettings;

            mainLayout.AddView(calendar);

            return(mainLayout);
        }
        void sampleSettings()
        {
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            calendar.MonthViewSettings          = monthSettings;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                calendar.HeaderHeight = 50;
                //sampleLayout.Padding = new Thickness(10, 10, 10, 10);
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                calendar.HeaderHeight = 40;
                //sampleLayout.Padding = new Thickness(10, 10, 10, 0);
            }
            if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Phone)
            {
                //sampleLayout.Scale = 0.95;
            }
        }
        //Initializing ConfigurationSettings
        private void InitializingConfigurationSettings()
        {
            day_view_setting       = new DayViewSettings();
            week_view_setting      = new WeekViewSettings();
            work_week_view_setting = new WorkWeekViewSettings();
            month_view_setting     = new MonthViewSettings();

            NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock();

            nonAccessibleBlock.StartTime = 13;
            nonAccessibleBlock.EndTime   = 14;
            nonAccessibleBlock.Text      = "Lunch Time";
            day_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            week_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            work_week_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            month_view_setting.ShowWeekNumber = true;

            Schedule.DayViewSettings      = day_view_setting;
            Schedule.WeekViewSettings     = week_view_setting;
            Schedule.WorkWeekViewSettings = work_week_view_setting;

            month_view_setting.MonthLabelSettings = new MonthLabelSettings();
            Schedule.MonthViewSettings            = month_view_setting;

            List <DateTime> black_out_days = new List <DateTime>();

            for (int i = 0; i < count; i++)
            {
                DateTime date = DateTime.Now.Date.AddDays(i);
                black_out_days.Add(date);
            }
        }
Esempio n. 9
0
        public override View GetSampleContent(Context context)
        {
            InitialSettings(context);

            //mainLayout
            mainLayout = new FrameLayout(context);
            mainLayout.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(totalHeight * 0.8), GravityFlags.Top | GravityFlags.CenterHorizontal);
            calendar                  = new SfCalendar(context);
            calendar.ViewMode         = ViewMode.MonthView;
            calendar.HeaderHeight     = 100;
            calendar.ShowEventsInline = false;
            calendar.Locale           = new Java.Util.Locale("zh", "CN");
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting  = labelSettings;
            monthViewSettings.TodayTextColor         = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor  = Color.ParseColor("#E4E8ED");
            monthViewSettings.WeekDayBackgroundColor = Color.ParseColor("#F7F7F7");
            calendar.MonthViewSettings = monthViewSettings;
            mainLayout.AddView(calendar);

            FrameLayout(context);

            return(frame);
        }
        void BlackOutDaysSwitchToggled(object sender, ToggledEventArgs e)
        {
            if (e.Value)
            {
                ObservableCollection <DateTime> black_out_days_collection = new ObservableCollection <DateTime>();

                DateTime date  = DateTime.Now.Date;
                DateTime date1 = DateTime.Now.Date.AddDays(1);
                DateTime date2 = DateTime.Now.Date.AddDays(2);
                DateTime date3 = DateTime.Now.Date.AddDays(3);
                DateTime date4 = DateTime.Now.Date.AddDays(4);
                DateTime date5 = DateTime.Now.Date.AddDays(5);

                black_out_days_collection.Add(date);
                black_out_days_collection.Add(date1);
                black_out_days_collection.Add(date2);
                black_out_days_collection.Add(date3);
                black_out_days_collection.Add(date4);
                black_out_days_collection.Add(date5);
                MonthViewSettings month_view_setting1 = new MonthViewSettings();
                month_view_setting1.BlackoutDates = black_out_days_collection;
                Schedule.MonthViewSettings        = month_view_setting1;
            }
            else
            {
                Schedule.MonthViewSettings = new MonthViewSettings();
                Schedule.MonthViewSettings.BlackoutDates = new ObservableCollection <DateTime>();
            }
        }
        void sampleSettings()
        {
            this.Padding = new Thickness(-10);
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            calendar.MonthViewSettings          = monthSettings;
            if (Device.OS == TargetPlatform.Android)
            {
                calendar.HeaderHeight = 50;
                //sampleLayout.Padding = new Thickness(10, 10, 10, 10);
            }
            else if (Device.OS == TargetPlatform.Windows)
            {
                calendar.HeaderHeight = 50;
                //sampleLayout.Padding = new Thickness(10, 10, 10, 10);
            }
            if (Device.OS == TargetPlatform.iOS)
            {
                calendar.HeaderHeight = 40;
                //sampleLayout.Padding = new Thickness(10, 10, 10, 0);
            }
            if (Device.OS == TargetPlatform.WinPhone)
            {
                //sampleLayout.Scale = 0.95;
            }
        }
Esempio n. 12
0
        public override View GetSampleContent(Context context)
        {
            sfschedule      = new SfSchedule(context);
            weekViewSetting = new WeekViewSettings();
            monthsettings   = new MonthViewSettings();
            propertylayout  = new FrameLayout(context);
            isInitialLoad   = true;
            propertylayout  = SetOptionPage(context);
            getAppointments();
            sfschedule.ItemsSource = appointmentCollection;

            sfschedule.ScheduleView = ScheduleView.WeekView;

            sfschedule.DayViewSettings.NonAccessibleBlocks      = SetNonAccessibleBlocks();
            sfschedule.WeekViewSettings.NonAccessibleBlocks     = SetNonAccessibleBlocks();
            sfschedule.WorkWeekViewSettings.NonAccessibleBlocks = SetNonAccessibleBlocks();

            monthsettings.BlackoutDates  = SetBlackoutDates();
            monthsettings.ShowWeekNumber = true;
            sfschedule.MonthViewSettings = monthsettings;

            sfschedule.LayoutParameters = new FrameLayout.LayoutParams(
                LinearLayout.LayoutParams.MatchParent,
                LinearLayout.LayoutParams.MatchParent);
            LinearLayout layout = new LinearLayout(context);

            layout.Orientation = Android.Widget.Orientation.Vertical;
            layout.AddView(sfschedule);
            return(layout);
        }
Esempio n. 13
0
        //void OnSizeChanged(object sender, EventArgs e)
        //{
        //}

        void sampleSettings()
        {
            width = Core.SampleBrowser.ScreenWidth;
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#F5F5F5");
            monthSettings.DateSelectionColor    = Color.FromHex("#E0E0E0");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            cal.MonthViewSettings = monthSettings;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                cal.HeaderHeight = 50;
            }
            if (Device.Idiom == TargetIdiom.Tablet)
            {
                width /= 2;
            }

            if (Device.RuntimePlatform == "iOS")
            {
                cal.HeaderHeight = 40;
            }
        }
Esempio n. 14
0
        public override View GetSampleContent(Context context)
        {
            /************
            **Calendar**
            ************/
            calendar                  = new SfCalendar(context);
            calendar.ViewMode         = ViewMode.MonthView;
            calendar.ShowEventsInline = true;
            getAppointments();
            calendar.DataSource   = appointmentCollection;
            calendar.HeaderHeight = 100;
            //Month View Settings
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting  = labelSettings;
            monthViewSettings.TodayTextColor         = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor  = Color.ParseColor("#E4E8ED");
            monthViewSettings.WeekDayBackgroundColor = Color.ParseColor("#F7F7F7");
            calendar.MonthViewSettings = monthViewSettings;

            //Main View
            mainView = new FrameLayout(context);
            mainView.AddView(calendar);
            calendar.UpdateCalendar();

            return(mainView);
        }
Esempio n. 15
0
        public Configuration_Default()
        {
            InitializeComponent();

            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.WeekEndTextColor      = Color.FromHex("#009688");
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;

            calendar.MonthViewSettings = monthSettings;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                calendar.HeaderHeight = 50;
            }
            if (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop)
            {
                mainStack.Children.Remove(selectionmodeLayout);
            }
            //monthViewSettings();
            this.sampleSettings();
            eventsInitialization();
        }
Esempio n. 16
0
        public View GetSampleContent(Context con)
        {
            context = con;

            /************
            **Calendar**
            ************/
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting        = labelSettings;
            monthViewSettings.TodayTextColor               = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor        = Color.ParseColor("#E4E8ED");
            monthViewSettings.CurrentMonthTextColor        = Color.ParseColor("#F7F7F7");
            monthViewSettings.SelectedDayTextColor         = Color.Black;
            monthViewSettings.WeekDayBackgroundColor       = Color.ParseColor("#464646");
            monthViewSettings.WeekDayTextColor             = Color.ParseColor("#F9F9F9");
            monthViewSettings.PreviousMonthTextColor       = Color.ParseColor("#BFBFBF");
            monthViewSettings.PreviousMonthBackgroundColor = Color.ParseColor("#F9F9F9");

            //Calendar Inizializatation
            calendar = new SfCalendar(con);
            calendar.ShowEventsInline  = false;
            calendar.HeaderHeight      = 100;
            calendar.ViewMode          = ViewMode.MonthView;
            calendar.MonthViewSettings = monthViewSettings;
            calendar.DrawMonthCell    += Calendar_DrawMonthCell;

            //main View
            mainView = new FrameLayout(con);
            mainView.AddView(calendar);
            return(mainView);
        }
Esempio n. 17
0
        void monthViewSettings()
        {
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DateSelectionColor = Color.FromRgb(161, 161, 161);
            calendar.MonthViewSettings       = monthSettings;
        }
Esempio n. 18
0
        public override View GetSampleContent(Context context)
        {
            /************
            **Calendar**
            ************/
            calendar = new SfCalendar(context);
            calendar.ShowEventsInline = false;
            calendar.ViewMode         = ViewMode.MonthView;
            calendar.BlackoutDates    = GetBlackOutDates();
            calendar.HeaderHeight     = 100;

            //MonthViewSettings
            MonthViewLabelSetting labelSettings = new MonthViewLabelSetting();

            labelSettings.DateLabelSize = 14;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.MonthViewLabelSetting  = labelSettings;
            monthViewSettings.SelectedDayTextColor   = Color.Black;
            monthViewSettings.TodayTextColor         = Color.ParseColor("#1B79D6");
            monthViewSettings.InlineBackgroundColor  = Color.ParseColor("#E4E8ED");
            monthViewSettings.WeekDayBackgroundColor = Color.ParseColor("#F7F7F7");
            calendar.MonthViewSettings = monthViewSettings;

            //Main View
            mainView = new FrameLayout(context);
            mainView.AddView(calendar);
            return(mainView);
        }
Esempio n. 19
0
 protected override void OnSizeAllocated(double width, double height)
 {
     base.OnSizeAllocated(width, height);
     if (Device.OS == TargetPlatform.iOS && Device.Idiom == TargetIdiom.Phone)
     {
         if (width > height)
         {
             MonthViewSettings monthSettings = new MonthViewSettings();
             monthSettings.DayHeight             = 20;
             monthSettings.DayCellFont           = Font.SystemFontOfSize(10);
             monthSettings.SelectionRadius       = 5;
             monthSettings.WeekEndTextColor      = Color.FromHex("#009688");
             monthSettings.HeaderBackgroundColor = Color.White;
             monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
             monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
             monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
             monthSettings.SelectedDayTextColor  = Color.Black;
             monthSettings.DateTextAlignment     = DateTextAlignment.Center;
             calendar.MonthViewSettings          = monthSettings;
         }
         else
         {
             MonthViewSettings monthSettings = new MonthViewSettings();
             monthSettings.DayHeight             = 50;
             monthSettings.WeekEndTextColor      = Color.FromHex("#009688");
             monthSettings.HeaderBackgroundColor = Color.White;
             monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
             monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
             monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
             monthSettings.SelectedDayTextColor  = Color.Black;
             monthSettings.DateTextAlignment     = DateTextAlignment.Center;
             calendar.MonthViewSettings          = monthSettings;
         }
     }
 }
Esempio n. 20
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);

            this.calendar  = bindable.Content.FindByName <Syncfusion.SfCalendar.XForms.SfCalendar>("calendar");
            this.viewModel = bindable.BindingContext as LocalizationViewModel;
            this.grid      = bindable.Content.FindByName <Grid>("grid");
            if (Device.RuntimePlatform == "UWP")
            {
                this.grid.HorizontalOptions = LayoutOptions.Center;
                this.grid.VerticalOptions   = LayoutOptions.Center;
                this.grid.HeightRequest     = this.calendarHeight;
                this.grid.WidthRequest      = this.calendarWidth;
                bindable.SizeChanged       += this.Bindable_SizeChanged;
            }

            this.calendar.Locale         = new System.Globalization.CultureInfo("zh-CN");
            this.calendar.FirstDayofWeek = 1;
            MonthViewSettings monthSettings = new MonthViewSettings
            {
                HeaderBackgroundColor         = Color.White,
                InlineBackgroundColor         = Color.FromHex("#EEEEEE"),
                DateSelectionColor            = Color.FromHex("#EEEEEE"),
                TodayTextColor                = Color.Red,
                SelectedDayTextColor          = Color.Black,
                DayHeaderFormat               = "EEE",
                TodaySelectionBackgroundColor = Color.Red,
                TodayBorderColor              = Color.Transparent
            };

            this.calendar.MonthViewSettings = monthSettings;
            if (Device.Idiom == TargetIdiom.Tablet)
            {
                if (Device.RuntimePlatform == "Android")
                {
                    this.calendar.MonthViewSettings.SelectionRadius = 30;
                }
                else
                {
                    this.calendar.MonthViewSettings.SelectionRadius = 20;
                }
            }

            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                this.calendar.HeaderHeight = 50;
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                this.calendar.HeaderHeight = 40;
            }

            var localePicker = bindable.Content.FindByName <Picker>("localePicker");

            localePicker.SelectedIndex         = 0;
            localePicker.SelectedIndexChanged += LocalePicker_SelectedIndexChanged;;
        }
Esempio n. 21
0
        public InlineEvents()
        {
            InitializeComponent();
            this.Padding = new Thickness(-10);
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.WeekEndTextColor      = Color.FromHex("#009688");
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            calendar.MonthViewSettings          = monthSettings;
            if (Device.OS == TargetPlatform.Android)
            {
                calendar.HeaderHeight = 50;
            }
            else if (Device.OS == TargetPlatform.Windows)
            {
                calendar.HeaderHeight = 50;
            }
            if (Device.OS == TargetPlatform.iOS)
            {
                calendar.HeaderHeight = 40;
            }

            viewModePicker.Items.Add("Inline");
            viewModePicker.Items.Add("Agenda");
            viewModePicker.SelectedIndex         = 0;
            viewModePicker.SelectedIndexChanged += ViewModePicker_SelectedIndexChanged;;
            calendarEventCollection              = new CalendarEventCollection();
            setColors();
            setSubjects();
            setStartTime();
            setEndTime();
            for (int i = 0; i < 5; i++)
            {
                CalendarInlineEvent appointment = new CalendarInlineEvent();
                appointment.Color     = Color.FromHex(colorCollection[i]);
                appointment.Subject   = subjectCollection[i];
                appointment.StartTime = startTimeCollection[i];
                appointment.EndTime   = endTimeCollection[i];
                calendarEventCollection.Add(appointment);
            }
            for (int i = 0; i < 5; i++)
            {
                CalendarInlineEvent appointment2 = new CalendarInlineEvent();
                appointment2.Color     = Color.FromHex(colorCollection2[i]);
                appointment2.Subject   = subjectCollection2[i];
                appointment2.StartTime = startTimeCollection2[i];
                appointment2.EndTime   = endTimeCollection2[i];
                calendarEventCollection.Add(appointment2);
            }
            calendar.BindingContext = calendarEventCollection;
        }
        protected override void OnAttachedTo(SfSchedule bindable)
        {
            sfSchedule = bindable;
            MonthViewSettings monthViewSettings = new MonthViewSettings();

            monthViewSettings.TodayBackground  = Color.Transparent;
            sfSchedule.MonthViewSettings       = monthViewSettings;
            sfSchedule.OnMonthCellLoadedEvent += SfSchedule_OnMonthCellLoadedEvent;
            base.OnAttachedTo(bindable);
        }
        void monthSettings()
        {
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.HeaderTextColor          = Color.White;
            monthSettings.HeaderBackgroundColor    = Color.FromRgb(61, 61, 61);
            monthSettings.DayHeaderTextColor       = Color.White;
            monthSettings.DayHeaderBackgroundColor = Color.FromRgb(61, 61, 61);
            monthSettings.DateSelectionColor       = Color.FromRgb(161, 161, 161);
            calendar.MonthViewSettings             = monthSettings;
        }
Esempio n. 24
0
        public AgendaView()
        {
            schedule = new SFSchedule();
            schedule.ScheduleView = SFScheduleView.SFScheduleViewMonth;
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.ShowAppointmentsInline = false;
            monthSettings.ShowAgendaView         = true;
            schedule.MonthViewSettings           = monthSettings;
            schedule.ItemsSource = CreateAppointments();
            this.AddSubview(schedule);
        }
Esempio n. 25
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);

            this.calendar        = bindable.Content.FindByName <Syncfusion.SfCalendar.XForms.SfCalendar>("calendar");
            this.viewModel       = bindable.BindingContext as LocalizationViewModel;
            this.calendar.Locale = new System.Globalization.CultureInfo("zh-CN");
            MonthViewSettings monthSettings = new MonthViewSettings();

            if (Device.RuntimePlatform == "Android")
            {
                monthSettings.DayCellFont = Font.SystemFontOfSize(15);
                if (Device.Idiom == TargetIdiom.Tablet)
                {
                    monthSettings.SelectionRadius = 25;
                }
                else
                {
                    monthSettings.SelectionRadius = 20;
                }
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                monthSettings.SelectionRadius = 15;
            }

            monthSettings.HeaderFont            = Font.OfSize("SemiBold", monthSettings.HeaderFont.FontSize);
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            monthSettings.DayLabelTextAlignment = DayLabelTextAlignment.Center;
            monthSettings.CellGridOptions       = CellGridOptions.None;
            monthSettings.SelectionShape        = SelectionShape.Circle;
            monthSettings.DateTextAlignment     = DateTextAlignment.Center;
            this.calendar.MonthViewSettings     = monthSettings;
            this.calendar.FirstDayofWeek        = 1;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                this.calendar.HeaderHeight = 50;
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                this.calendar.HeaderHeight = 40;
            }

            var localePicker = bindable.Content.FindByName <Picker>("localePicker");

            localePicker.SelectedIndex         = 0;
            localePicker.SelectedIndexChanged += LocalePicker_SelectedIndexChanged;;
        }
Esempio n. 26
0
        void getmonthSettings()
        {
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.DayHeight             = 50;
            monthSettings.WeekEndTextColor      = Color.FromHex("#009688");
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            calendar.MonthViewSettings          = monthSettings;
        }
Esempio n. 27
0
        public AgendaView()
        {
            schedule = new SFSchedule();
            schedule.ScheduleView = SFScheduleView.SFScheduleViewMonth;
            schedule.SelectedDate = NSDate.Now;
            MonthViewSettings monthSettings = new MonthViewSettings();

            monthSettings.ShowAppointmentsInline = false;
            monthSettings.ShowAgendaView         = true;
            schedule.MonthViewSettings           = monthSettings;
            schedule.Appointments = CreateAppointments();
            this.AddSubview(schedule);
        }
Esempio n. 28
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);
            this.calendar = bindable.Content.FindByName <Syncfusion.SfCalendar.XForms.SfCalendar>("calendar");
            ObservableCollection <string> customLabels = new ObservableCollection <string> {
                "S", "M", "T", "W", "T", "F", "S"
            };

            this.calendar.CustomDayLabels = customLabels;
            MonthViewSettings monthSettings = new MonthViewSettings();

            if (Device.RuntimePlatform == "Android")
            {
                monthSettings.DayCellFont = Font.SystemFontOfSize(15);
                if (Device.Idiom == TargetIdiom.Tablet)
                {
                    monthSettings.SelectionRadius = 25;
                }
                else
                {
                    monthSettings.SelectionRadius = 20;
                }
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                monthSettings.SelectionRadius = 15;
            }

            monthSettings.HeaderFont            = Font.OfSize("SemiBold", monthSettings.HeaderFont.FontSize);
            monthSettings.HeaderBackgroundColor = Color.White;
            monthSettings.InlineBackgroundColor = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor    = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor        = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor  = Color.Black;
            monthSettings.DayLabelTextAlignment = DayLabelTextAlignment.Center;
            monthSettings.CellGridOptions       = CellGridOptions.None;
            monthSettings.SelectionShape        = SelectionShape.Circle;
            monthSettings.DateTextAlignment     = DateTextAlignment.Center;
            this.calendar.MonthViewSettings     = monthSettings;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                this.calendar.HeaderHeight = 50;
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                this.calendar.HeaderHeight = 40;
            }

            this.calendar.OnMonthCellLoaded += Calendar_OnMonthCellLoaded;
        }
 void ShowWeekNumberSwitchToggled(object sender, ToggledEventArgs e)
 {
     if (e.Value)
     {
         month_view_setting.ShowWeekNumber = true;
         Schedule.MonthViewSettings        = month_view_setting;
     }
     else
     {
         MonthViewSettings month_view_setting1 = new MonthViewSettings();
         month_view_setting1.ShowWeekNumber = false;
         Schedule.MonthViewSettings         = month_view_setting1;
     }
 }
Esempio n. 30
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);

            this.calendar        = bindable.Content.FindByName <Syncfusion.SfCalendar.XForms.SfCalendar>("calendar");
            this.viewModel       = bindable.BindingContext as LocalizationViewModel;
            this.calendar.Locale = new System.Globalization.CultureInfo("zh-CN");
            MonthViewSettings monthSettings = new MonthViewSettings();

            if (Device.RuntimePlatform == "Android")
            {
                if (Device.Idiom == TargetIdiom.Tablet)
                {
                    monthSettings.SelectionRadius = 25;
                }
                else
                {
                    monthSettings.SelectionRadius = 20;
                }
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                monthSettings.SelectionRadius = 15;
            }

            monthSettings.HeaderBackgroundColor         = Color.White;
            monthSettings.InlineBackgroundColor         = Color.FromHex("#EEEEEE");
            monthSettings.DateSelectionColor            = Color.FromHex("#EEEEEE");
            monthSettings.TodayTextColor                = Color.FromHex("#2196F3");
            monthSettings.SelectedDayTextColor          = Color.Black;
            monthSettings.DayHeaderFormat               = "EEE";
            monthSettings.TodaySelectionBackgroundColor = Color.Red;
            monthSettings.TodayBorderColor              = Color.Transparent;
            monthSettings.TodayTextColor                = Color.Red;
            this.calendar.MonthViewSettings             = monthSettings;
            this.calendar.FirstDayofWeek                = 1;
            if (Device.RuntimePlatform == "Android" || (Device.RuntimePlatform == "UWP" && Device.Idiom == TargetIdiom.Desktop))
            {
                this.calendar.HeaderHeight = 50;
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                this.calendar.HeaderHeight = 40;
            }

            var localePicker = bindable.Content.FindByName <Picker>("localePicker");

            localePicker.SelectedIndex         = 0;
            localePicker.SelectedIndexChanged += LocalePicker_SelectedIndexChanged;;
        }