public Localization()
        {
            InitializeComponent();

            WeekViewSettings weekviewsettings = new WeekViewSettings();

            weekviewsettings.WorkStartHour = 7;
            weekviewsettings.WorkEndHour   = 18;
            Schedule.WeekViewSettings      = weekviewsettings;
            //weekviewsettings.VerticalLineColor = Color.Blue;
            //weekviewsettings.TimeSlotColor = Color.Red;
            //weekviewsettings.TimeSlotBorderColor = Color.Black;

            //Schedule.TimeInterval = 120;
            //Schedule.TimeIntervalHeight = 200;

            if (Device.Idiom == TargetIdiom.Phone && Device.OS == TargetPlatform.Windows)
            {
                grid_layout.WidthRequest  = App.ScreenWidth;
                grid_layout.HeightRequest = App.ScreenHeight;
            }
            if (App.Platform == Platforms.UWP && Device.Idiom == TargetIdiom.Desktop)
            {
                Schedule.HeaderHeight = 40;
            }
            if (Device.Idiom == TargetIdiom.Tablet && Device.OS == TargetPlatform.Android)
            {
                Schedule.ViewHeaderHeight = 35;
            }
        }
Example #2
0
        private void SetNonWorkingHours()
        {
            daySettings      = new DayViewSettings();
            weekSettings     = new WeekViewSettings();
            workWeekSettings = new WorkWeekViewSettings();

            //Non-AccessbleBlocks
            NonAccessibleBlock lunch_hour = new NonAccessibleBlock();

            lunch_hour.StartHour = 13;
            lunch_hour.EndHour   = 14;
            lunch_hour.Text      = (NSString)"LUNCH";
            daySettings.NonAccessibleBlockCollection      = new NSMutableArray();
            weekSettings.NonAccessibleBlockCollection     = new NSMutableArray();
            workWeekSettings.NonAccessibleBlockCollection = new NSMutableArray();

            if (switchNonAccessbleBlock != null && switchNonAccessbleBlock.On)
            {
                daySettings.NonAccessibleBlockCollection.Add(lunch_hour);
                weekSettings.NonAccessibleBlockCollection.Add(lunch_hour);
                workWeekSettings.NonAccessibleBlockCollection.Add(lunch_hour);
            }

            schedule.DayViewSettings      = daySettings;
            schedule.WeekViewSettings     = weekSettings;
            schedule.WorkWeekViewSettings = workWeekSettings;
        }
Example #3
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);
        }
Example #4
0
        public override View GetSampleContent(Context context)
        {
            this.context = context;
            LinearLayout linearLayout = new LinearLayout(context);

            linearLayout.Orientation = Orientation.Vertical;

            //creating instance for Schedule
            sfSchedule = new SfSchedule(context);
            sfSchedule.ScheduleView         = ScheduleView.WeekView;
            sfSchedule.AllowAppointmentDrag = true;

            sfSchedule.AppointmentDrop += SfSchedule_AppointmentDrop;

            NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock();

            //Create new instance of NonAccessibleBlocksCollection
            NonAccessibleBlocksCollection nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection();
            WeekViewSettings weekViewSettings = new WeekViewSettings();

            nonAccessibleBlock.StartTime = 13;
            nonAccessibleBlock.EndTime   = 14;
            nonAccessibleBlock.Text      = "LUNCH";
            nonAccessibleBlock.Color     = Color.Black;
            nonAccessibleBlocksCollection.Add(nonAccessibleBlock);
            weekViewSettings.NonAccessibleBlocks = nonAccessibleBlocksCollection;
            sfSchedule.WeekViewSettings          = weekViewSettings;

            //set the appointment collection
            GetAppointments();
            sfSchedule.ItemsSource = appointmentCollection;
            linearLayout.AddView(sfSchedule);
            return(linearLayout);
        }
        //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);
            }
        }
Example #6
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //get Database
            _firestoreDb = _userService.GetDatabase(this);
            clientLogged = await _storageService.GetClientDataLocal();
            await GetConsultCategory();

            animalSelected = JsonConvert.DeserializeObject <Animal>(Intent.GetStringExtra("Animal"));

            SetContentView(Resource.Layout.pet_appointments_main);
            _scheduler             = FindViewById <SfSchedule>(Resource.Id.appointments_scheduler);
            progress               = new ProgressDialog(this);
            progress.Indeterminate = false;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Se afiseaza calendarul...");
            progress.SetCancelable(false);
            progress.Show();
            FetchAppointmentsWeek();
            var scheduleHours = GetMedicScheduleHours();

            _scheduler.ScheduleView = ScheduleView.WeekView;

            WeekViewSettings settings = new WeekViewSettings();

            settings.WeekLabelSettings.TimeFormat = "hh:mm";
            settings.StartHour = scheduleHours[0];
            settings.EndHour   = scheduleHours[1];

            // set medic working hours interval
            _scheduler.WeekViewSettings = settings;
            _scheduler.CellTapped      += Scheduler_CellTapped;
        }
        protected override void OnAttachedTo(ContentPage bindable)
        {
            base.OnAttachedTo(bindable);
            schedule = bindable.FindByName <SfSchedule>("schedule");
            schedule.TimeInterval = 1;

            WeekViewSettings weekViewSettings = new WeekViewSettings();

            weekViewSettings.WorkStartHour = 0;
            weekViewSettings.WorkEndHour   = 23;
            WeekLabelSettings weekLabelSettings = new WeekLabelSettings();

            weekLabelSettings.TimeFormat = string.Format("'Room'") + " " + "HH";

            weekViewSettings.WeekLabelSettings = weekLabelSettings;
            schedule.WeekViewSettings          = weekViewSettings;

            TimelineViewSettings timelineViewSettings = new TimelineViewSettings();

            timelineViewSettings.StartHour = 0;
            timelineViewSettings.EndHour   = 1;
            schedule.TimelineViewSettings  = timelineViewSettings;
            TimelineLabelSettings labelSettings = new TimelineLabelSettings();

            labelSettings.TimeFormat           = string.Format(" 'Room' ") + " " + "mm";
            timelineViewSettings.LabelSettings = labelSettings;
        }
Example #8
0
        public DragDrop()
        {
            schedule = new SFSchedule();
            schedule.ScheduleView = SFScheduleView.SFScheduleViewWeek;

            NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock();
            //Create new instance of NonAccessibleBlocksCollection
            NSMutableArray   nonAccessibleBlocksCollection = new NSMutableArray();
            WeekViewSettings weekViewSettings = new WeekViewSettings();

            nonAccessibleBlock.StartHour       = 13;
            nonAccessibleBlock.EndHour         = 14;
            nonAccessibleBlock.Text            = (NSString)"LUNCH";
            nonAccessibleBlock.BackgroundColor = UIColor.Black;
            nonAccessibleBlocksCollection.Add(nonAccessibleBlock);
            weekViewSettings.NonAccessibleBlockCollection = nonAccessibleBlocksCollection;
            schedule.WeekViewSettings = weekViewSettings;

            schedule.AllowAppointmentDrag     = true;
            schedule.AppointmentDragStarting += Schedule_AppointmentDragStarting;
            schedule.AppointmentDrop         += Schedule_AppointmentDrop;
            schedule.AppointmentDragOver     += Schedule_AppointmentDragOver;
            schedule.ItemsSource              = CreateAppointments();
            this.AddSubview(schedule);
        }
Example #9
0
        protected override void OnSizeAllocated(double width, double height)
        {
            base.OnSizeAllocated(width, height);
            if (width != this.width || height != this.height)
            {
                this.width  = width;
                this.height = height;
                if (width > height)
                {
                    Debug.WriteLine("Horizontal");
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        /* Switching to Week View
                         *
                         * Current Bug on Week View: All Day Events show up as an extra day long.
                         * Should not be programmed to subtract a day in datetime because the overall standard
                         * is that all day events are from one day at 0:0:0 to the next day at 0:0:0.
                         *
                         * SyncFusion says this bug should be fixed in their update at the end of May 2018 so
                         * please update the NuGet package then.
                         *
                         * https://www.syncfusion.com/forums/137099/all-day-event-rendering-as-two-days-in-week-view
                         *
                         */

                        cal.ScheduleView       = ScheduleView.WeekView;
                        cal.TimeIntervalHeight = 50;
                        cal.ViewHeaderHeight   = 55;

                        //Creating new instance of WeekViewSettings
                        WeekViewSettings weekViewSettings = new WeekViewSettings();
                        //Creating new instance of WeekLabelSettings
                        WeekLabelSettings weekLabelSettings = new WeekLabelSettings();

                        //custom UI
                        weekLabelSettings.DateFormat       = "dd";
                        weekViewSettings.WeekLabelSettings = weekLabelSettings;
                        weekViewSettings.ShowAllDay        = true;
                        weekViewSettings.StartHour         = 05;
                        cal.WeekViewSettings = weekViewSettings;

                        ViewHeaderStyle viewHeaderStyle = new ViewHeaderStyle();
                        viewHeaderStyle.DateFontSize    = 15;
                        cal.ViewHeaderStyle             = viewHeaderStyle;
                    });
                }
                else
                {
                    Debug.WriteLine("Vertical");
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        cal.ScheduleView = ScheduleView.MonthView;
                    });
                }
            }
        }
        public MainPage(Department filterDepartment = null)
        {
            PageLoaded = false;

            InitializeComponent();

            FilterDepartment = filterDepartment;

            // WorkScheduleItems = items;


            AppointmentCollection = new ScheduleAppointmentCollection();

            schedule.AllowAppointmentDrag = true;

            schedule.CellTapped += Schedule_CellTapped;

            schedule.CellDoubleTapped += Schedule_CellDoubleTapped;

            schedule.AppointmentDragStarting += Schedule_AppointmentDragStarting;

            schedule.AppointmentDrop += Schedule_AppointmentDrop;

            WeekViewSettings weekViewSeetings = new WeekViewSettings();

            weekViewSeetings.ShowAllDay = true;
            weekViewSeetings.AllDayAppointmentLayoutColor = Color.Beige;
            schedule.WeekViewSettings = weekViewSeetings;

            //NonAccessibleBlock block = new NonAccessibleBlock();
            //block.StartTime = item.From.Hour;
            //block.EndTime = item.To.Hour;
            //SelectedColor = Color.Red;

            displayTypePicker.Items.Add("Month View");
            displayTypePicker.Items.Add("Week View");
            displayTypePicker.SelectedIndexChanged += DisplayTypePicker_SelectedIndexChanged;
            displayTypePicker.SelectedIndex         = 0;

            MessagingCenter.Subscribe <NewAppointmentPage, WorkScheduleItem>(this, "Done", (sender, arg) =>
            {
                WorkScheduleItem workitem = arg as WorkScheduleItem;

                /*var wi = this.WorkItems.SingleOrDefault(w => w.Id == workitem.Id);
                 * if ( wi != null)
                 *  this.WorkItems.Remove(wi);
                 * this.WorkItems.Add(workitem);
                 * this.schedule.DataSource = WorkItems;*/
                // this.InvalidateMeasure();
            });
            //schedule.WorkWeekViewSettings.NonAccessibleBlocks.Add(block);
        }
Example #11
0
        /// <summary>
        /// Sets the non accessible blocks.
        /// </summary>
        private void SetNonAccessibleBlocks()
        {
            if (Device.RuntimePlatform == "Android" || Device.RuntimePlatform == "iOS")
            {
                NonAccessibleBlocksCollection nonAccessibleBlocks = new NonAccessibleBlocksCollection();
                var nonAccessibleBlock = new NonAccessibleBlock();
                nonAccessibleBlock.StartTime = 13;
                nonAccessibleBlock.EndTime   = 14;
                nonAccessibleBlock.Text      = "Lunch time";
                nonAccessibleBlocks.Add(nonAccessibleBlock);

                var dayViewSettings = new DayViewSettings();
                dayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.DayViewSettings       = dayViewSettings;

                var weekViewSettings = new WeekViewSettings();
                weekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.WeekViewSettings       = weekViewSettings;

                var workWeekViewSettings = new WorkWeekViewSettings();
                workWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.WorkWeekViewSettings       = workWeekViewSettings;
            }
        }
Example #12
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (schedule != null)
                {
                    schedule.Dispose();
                    schedule = null;
                }

                if (OptionView != null)
                {
                    this.OptionView.RemoveFromSuperview();
                    this.OptionView.Dispose();
                    this.OptionView = null;
                }

                if (buttonScheduleView != null)
                {
                    buttonScheduleView.TouchUpInside -= ShowPicker1;
                    buttonScheduleView.Dispose();
                    buttonScheduleView = null;
                }

                if (doneButton != null)
                {
                    doneButton.TouchUpInside -= HidePicker;
                    doneButton.Dispose();
                    doneButton = null;
                }

                if (rangeslider != null)
                {
                    rangeslider.RangeValueChange -= Slider_RangeValueChange;
                    rangeslider.Dispose();
                    rangeslider = null;
                }

                if (daySettings != null)
                {
                    daySettings.Dispose();
                    daySettings = null;
                }

                if (labelBlackOutDays != null)
                {
                    labelBlackOutDays.Dispose();
                    labelBlackOutDays = null;
                }

                if (labelScheduleView != null)
                {
                    labelScheduleView.Dispose();
                    labelScheduleView = null;
                }

                if (labelShowNonAccess != null)
                {
                    labelShowNonAccess.Dispose();
                    labelShowNonAccess = null;
                }

                if (labelWeekNumber != null)
                {
                    labelWeekNumber.Dispose();
                    labelWeekNumber = null;
                }

                if (labelWorkingHours != null)
                {
                    labelWorkingHours.Dispose();
                    labelWorkingHours = null;
                }

                if (monthSettings != null)
                {
                    monthSettings.Dispose();
                    monthSettings = null;
                }

                if (pickerScheduleView != null)
                {
                    pickerScheduleView.Dispose();
                    pickerScheduleView = null;
                }

                if (switchBlackOutDates != null)
                {
                    switchBlackOutDates.Dispose();
                    switchBlackOutDates = null;
                }

                if (switchNonAccessbleBlock != null)
                {
                    switchNonAccessbleBlock.Dispose();
                    switchNonAccessbleBlock = null;
                }

                if (switchWeekNumber != null)
                {
                    switchWeekNumber.Dispose();
                    switchWeekNumber = null;
                }

                if (weekSettings != null)
                {
                    weekSettings.Dispose();
                    weekSettings = null;
                }

                if (workWeekSettings != null)
                {
                    workWeekSettings.Dispose();
                    workWeekSettings = null;
                }
            }

            base.Dispose(disposing);
        }