protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);

            schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");

            viewPicker = bindable.PropertyView.FindByName <Picker>("viewPicker");

            label = bindable.Content.FindByName <Label>("labelIndicator");
            label.WidthRequest    = schedule.Width;
            label.BackgroundColor = Color.FromHex("#2e2f30");

            if (bindable.GetType().Equals(typeof(RecursiveAppointments)))
            {
                viewPicker.SelectedIndex = 3;
            }
            else if (bindable.GetType().Equals(typeof(ViewCustomization)))
            {
                viewPicker.SelectedIndex = 0;
            }
            else
            {
                viewPicker.SelectedIndex = 2;
            }

            viewPicker.SelectedIndexChanged += ViewPicker_SelectedIndexChanged;
            schedule.AppointmentDrop        += Schedule_AppointmentDrop;
            schedule.CellTapped             += Schedule_CellTapped;

            SetNonAccessibleBlocks();
        }
示例#2
0
        /// <summary>
        /// Begins when the behavior attached to the view.
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            this.scheduleHeaderGrid = ((bindable.Content as Grid).Children[0] as Grid);
            this.scheduleViewButton = ((bindable.Content as Grid).Children[0] as Grid).Children[0] as Button;
            this.header             = ((bindable.Content as Grid).Children[0] as Grid).Children[1] as Label;
            this.editorButton       = ((bindable.Content as Grid).Children[0] as Grid).Children[2] as Button;

            this.schedule         = (bindable.Content as Grid).Children[1] as Syncfusion.SfSchedule.XForms.SfSchedule;
            this.scheduleViewList = (bindable.Content as Grid).Children[2] as ListView;
            this.editorLayout     = (bindable.Content as Grid).Children[3] as EditorLayout;

            this.timeZonePicker                       = bindable.FindByName <Picker>("timeZonePicker");
            this.timeZonePicker.ItemsSource           = TimeZoneCollection.TimeZoneList;
            this.timeZonePicker.SelectedIndex         = 0;
            this.timeZonePicker.SelectedIndexChanged += this.TimeZonePicker_SelectedIndexChanged;

            this.schedule.VisibleDatesChangedEvent     += this.Schedule_VisibleDatesChangedEvent;
            this.schedule.MonthInlineAppointmentTapped += this.Schedule_MonthInlineAppointmentTapped;
            this.schedule.CellDoubleTapped             += this.Schedule_CellDoubleTapped;
            this.schedule.CellTapped           += this.Schedule_CellTapped;
            this.scheduleViewList.ItemSelected += this.ScheduleViewList_ItemSelected;

            this.scheduleViewButton.Clicked += this.ScheduleViewButton_Clicked;
            this.editorButton.Clicked       += this.EditorButton_Clicked;

            (this.editorLayout.BindingContext as EditorLayoutViewModel).AppointmentModified += this.EditorLayout_AppointmentModified;
            (this.editorLayout.Behaviors[0] as EditorLayoutBehavior).AddEditorElements();

            if (Device.RuntimePlatform == "Android")
            {
                this.scheduleHeaderGrid.ColumnDefinitions[0].Width = new GridLength(0.1, GridUnitType.Star);
                this.header.FontSize = 20;
            }
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnDetachingFrom(SampleView bindable)
        {
            base.OnDetachingFrom(bindable);

            if (this.viewPicker != null)
            {
                this.viewPicker.SelectedIndexChanged -= this.ViewPicker_SelectedIndexChanged;
                this.viewPicker = null;
            }

            if (this.localePicker != null)
            {
                this.localePicker.SelectedIndexChanged -= this.LocalePicker_SelectedIndexChanged;
                this.localePicker = null;
            }

            if (currentTime != null)
            {
                this.currentTime.Toggled -= CurrentTime_Toggled;
                this.currentTime          = null;
            }

            if (showCurrentTime != null)
            {
                this.showCurrentTime = null;
            }

            if (this.schedule != null)
            {
                this.schedule = null;
            }
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable param</param>
        protected override void OnDetachingFrom(ContentPage bindable)
        {
            this.schedule.CellDoubleTapped -= this.OnSchedulerCellDoubleTapped;
            (this.editorLayout.BindingContext as EditorLayoutViewModel).AppointmentModified -= this.OnEditorLayoutAppointmentModified;

            this.schedule     = null;
            this.editorLayout = null;
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            base.OnAttachedTo(bindable);
            this.schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");
            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderStyle.DateFontSize = 24;
            }

            this.CreateAppointmentSubjects();
            this.schedule.VisibleDatesChangedEvent += this.Schedule_VisibleDatesChangedEvent;
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnDetachingFrom(SampleView bindable)
        {
            this.startTimeSlider.ValueChanged    -= this.StartTimeSlider_ValueChanged;
            this.endTimeSlider.ValueChanged      -= this.EndTimeSlider_ValueChanged;
            this.viewPicker.SelectedIndexChanged -= this.ViewPicker_SelectedIndexChanged;
            this.datePicker.DateSelected         -= this.DatePicker_DateSelected;

            this.schedule        = null;
            this.startTimeSlider = null;
            this.endTimeSlider   = null;
            this.viewPicker      = null;
            this.datePicker      = null;
        }
        protected override void OnDetachingFrom(SampleView bindable)
        {
            startTimeSlider.ValueChanged    -= StartTimeSlider_ValueChanged;
            endTimeSlider.ValueChanged      -= EndTimeSlider_ValueChanged;
            viewPicker.SelectedIndexChanged -= ViewPicker_SelectedIndexChanged;
            datePicker.DateSelected         -= DatePicker_DateSelected;

            schedule        = null;
            startTimeSlider = null;
            endTimeSlider   = null;
            viewPicker      = null;
            datePicker      = null;
        }
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");

            if (schedule?.Locale == "ja")
            {
                localizationViewModel = new LocalizationViewModel();
                localePicker          = bindable.PropertyView.FindByName <Picker>("localePicker");
                if (localePicker == null)
                {
                    return;
                }
                localePicker.SelectedIndex         = 0;
                localePicker.SelectedIndexChanged += LocalePicker_SelectedIndexChanged;
                schedule.DataSource = localizationViewModel.JapaneseAppointments;
            }


            viewPicker = bindable.PropertyView.FindByName <Picker>("viewPicker");

            if (viewPicker == null)
            {
                return;
            }

            if (bindable.GetType().Equals(typeof(RecursiveAppointments)))
            {
                viewPicker.SelectedIndex = 3;
            }
            else if (bindable.GetType().Equals(typeof(ViewCustomization)))
            {
                viewPicker.SelectedIndex = 3;
            }
            else if (bindable.GetType().Equals(typeof(Localization)))
            {
                viewPicker.SelectedIndex = 1;
            }
            else
            {
                viewPicker.SelectedIndex = 2;
            }

            viewPicker.SelectedIndexChanged += ViewPicker_SelectedIndexChanged;
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnDetachingFrom(SampleView bindable)
        {
            base.OnDetachingFrom(bindable);

            if (this.viewPicker != null)
            {
                this.viewPicker.SelectedIndexChanged -= this.ViewPicker_SelectedIndexChanged;
                this.viewPicker = null;
            }

            if (this.schedule != null)
            {
                this.schedule = null;
            }
        }
        /// <summary>
        /// Begins when the behavior attached to the view.
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(ContentPage bindable)
        {
            this.schedule = (bindable.Content as Grid).Children[0] as Syncfusion.SfSchedule.XForms.SfSchedule;

            this.editorLayout = (bindable.Content as Grid).Children[1] as EditorLayout;

            this.schedule.TimelineViewSettings.AppointmentHeight = 1000;

            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderStyle.DateFontSize = 24;
            }

            this.schedule.CellDoubleTapped += this.OnSchedulerCellDoubleTapped;
            (this.editorLayout.BindingContext as EditorLayoutViewModel).AppointmentModified += this.OnEditorLayoutAppointmentModified;
            (this.editorLayout.Behaviors[0] as EditorLayoutBehavior).AddEditorElements();
        }
示例#11
0
        /// <summary>
        /// Disposing the elements
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnDetachingFrom(SampleView bindable)
        {
            base.OnDetachingFrom(bindable);

            if (this.viewPicker != null)
            {
                this.viewPicker.SelectedIndexChanged -= this.ViewPicker_SelectedIndexChanged;
                this.viewPicker = null;
            }

            if (this.schedule != null)
            {
                this.schedule.AppointmentDrop -= this.Schedule_AppointmentDrop;
                this.schedule.CellTapped      -= this.Schedule_CellTapped;
                this.schedule = null;
            }
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable param</param>
        protected override void OnDetachingFrom(SampleView bindable)
        {
            this.schedule.VisibleDatesChangedEvent     -= this.Schedule_VisibleDatesChangedEvent;
            this.schedule.MonthInlineAppointmentTapped -= this.Schedule_MonthInlineAppointmentTapped;
            this.schedule.CellDoubleTapped             -= this.Schedule_CellDoubleTapped;
            this.schedule.CellTapped           -= this.Schedule_CellTapped;
            this.scheduleViewList.ItemSelected -= this.ScheduleViewList_ItemSelected;

            this.scheduleViewButton.Clicked -= this.ScheduleViewButton_Clicked;
            this.editorButton.Clicked       -= this.EditorButton_Clicked;
            (this.editorLayout.BindingContext as EditorLayoutViewModel).AppointmentModified -= this.EditorLayout_AppointmentModified;

            this.scheduleViewButton = null;
            this.header             = null;
            this.editorButton       = null;
            this.schedule           = null;
            this.scheduleViewList   = null;
            this.editorLayout       = null;
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">binadable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            this.schedule = (bindable.Content as Grid).Children[0] as Syncfusion.SfSchedule.XForms.SfSchedule;

            this.startTimeSlider = bindable.FindByName <Slider>("startTimeSlider");
            this.endTimeSlider   = bindable.FindByName <Slider>("endTimeSlider");
            this.viewPicker      = bindable.FindByName <Picker>("viewPicker");
            this.datePicker      = bindable.FindByName <DatePicker>("datePicker");
            this.startHourLabel  = bindable.FindByName <Label>("startHourLabel");
            this.endHourLabel    = bindable.FindByName <Label>("endHourLabel");

            this.viewPicker.SelectedIndex = 0;

            this.startTimeSlider.ValueChanged    += this.StartTimeSlider_ValueChanged;
            this.endTimeSlider.ValueChanged      += this.EndTimeSlider_ValueChanged;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
            this.datePicker.DateSelected         += this.DatePicker_DateSelected;

            this.SetNonAccessibleBlocks();
        }
示例#14
0
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            this.schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");

            this.viewPicker = bindable.FindByName <Picker>("viewPicker");
            if (this.viewPicker == null)
            {
                return;
            }

            this.viewPicker.SelectedIndex         = 1;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
        }
        protected override void OnAttachedTo(SampleView bindable)
        {
            schedule = (bindable.Content as Grid).Children[0] as Syncfusion.SfSchedule.XForms.SfSchedule;

            startTimeSlider = bindable.PropertyView.FindByName <Slider>("startTimeSlider");
            endTimeSlider   = bindable.PropertyView.FindByName <Slider>("endTimeSlider");
            viewPicker      = bindable.PropertyView.FindByName <Picker>("viewPicker");
            datePicker      = bindable.PropertyView.FindByName <DatePicker>("datePicker");
            startHourLabel  = bindable.PropertyView.FindByName <Label>("startHourLabel");
            endHourLabel    = bindable.PropertyView.FindByName <Label>("endHourLabel");

            viewPicker.SelectedIndex = 0;

            startTimeSlider.ValueChanged    += StartTimeSlider_ValueChanged;
            endTimeSlider.ValueChanged      += EndTimeSlider_ValueChanged;
            viewPicker.SelectedIndexChanged += ViewPicker_SelectedIndexChanged;
            datePicker.DateSelected         += DatePicker_DateSelected;

            SetNonAccessibleBlocks();
        }
示例#16
0
        protected override void OnDetachingFrom(ContentPage bindable)
        {
            schedule.VisibleDatesChangedEvent     -= Schedule_VisibleDatesChangedEvent;
            schedule.MonthInlineAppointmentTapped -= Schedule_MonthInlineAppointmentTapped;
            schedule.CellDoubleTapped             -= Schedule_CellDoubleTapped;
            schedule.CellTapped           -= Schedule_CellTapped;
            scheduleViewList.ItemSelected -= ScheduleViewList_ItemSelected;

            scheduleViewButton.Clicked -= ScheduleViewButton_Clicked;
            editorButton.Clicked       -= EditorButton_Clicked;
            settingButton.Clicked      -= SettingButton_Clicked;
            (editorLayout.BindingContext as ViewModels.EditorLayoutViewModel).AppointmentModified -= EditorLayout_AppointmentModified;

            scheduleViewButton = null;
            header             = null;
            editorButton       = null;
            settingButton      = null;
            schedule           = null;
            scheduleViewList   = null;
            editorLayout       = null;
        }
        protected override void OnDetachingFrom(SampleView bindable)
        {
            base.OnDetachingFrom(bindable);

            if (viewPicker != null)
            {
                viewPicker.SelectedIndexChanged -= ViewPicker_SelectedIndexChanged;
                viewPicker = null;
            }

            if (localePicker != null)
            {
                localePicker.SelectedIndexChanged -= LocalePicker_SelectedIndexChanged;
                localePicker = null;
            }

            if (schedule != null)
            {
                schedule = null;
            }
        }
示例#18
0
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">binadable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            this.schedule = (bindable.Content as Grid).Children[0] as Syncfusion.SfSchedule.XForms.SfSchedule;
            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderStyle.DateFontSize = 24;
            }

            this.startTimeSlider          = bindable.FindByName <Slider>("startTimeSlider");
            this.endTimeSlider            = bindable.FindByName <Slider>("endTimeSlider");
            this.viewPicker               = bindable.FindByName <Picker>("viewPicker");
            this.datePicker               = bindable.FindByName <DatePicker>("datePicker");
            this.startHourLabel           = bindable.FindByName <Label>("startHourLabel");
            this.endHourLabel             = bindable.FindByName <Label>("endHourLabel");
            this.showTimeLabel            = bindable.FindByName <Switch>("timeLabelWidth");
            this.viewPicker.SelectedIndex = 0;

            this.startTimeSlider.ValueChanged    += this.StartTimeSlider_ValueChanged;
            this.endTimeSlider.ValueChanged      += this.EndTimeSlider_ValueChanged;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
            this.datePicker.DateSelected         += this.DatePicker_DateSelected;
            this.showTimeLabel.Toggled           += this.ShowTimeLabel_Toggled;
            this.SetNonAccessibleBlocks();
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            this.schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");
            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderStyle.DateFontSize = 24;
            }

            this.viewPicker = bindable.FindByName <Picker>("viewPicker");
            if (this.viewPicker == null)
            {
                return;
            }

            this.viewPicker.SelectedIndex         = 1;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
        }
 /// <summary>
 /// Begins when the behavior attached to the view.
 /// </summary>
 /// <param name="bindable">bindable value</param>
 protected override void OnDetachingFrom(SampleView bindable)
 {
     base.OnDetachingFrom(bindable);
     bindable.SizeChanged -= Bindable_SizeChanged;
     this.schedule         = null;
 }
 /// <summary>
 /// Begins when the behavior attached to the view.
 /// </summary>
 /// <param name="bindable">bindable value</param>
 protected override void OnAttachedTo(SampleView bindable)
 {
     base.OnAttachedTo(bindable);
     bindable.SizeChanged += Bindable_SizeChanged;
     this.schedule         = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("schedule");
 }
 protected override void OnAttachedTo(SampleView bindable)
 {
     base.OnAttachedTo(bindable);
     schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("schedule");
 }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            this.schedule        = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");
            this.currentTime     = bindable.FindByName <Switch>("currentTime");
            this.showCurrentTime = bindable.FindByName <Label>("showCurrentTime");
            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderStyle.DateFontSize = 24;
            }

            if (this.schedule?.Locale == "ja")
            {
                this.localizationViewModel = new LocalizationViewModel();
                this.localePicker          = bindable.FindByName <Picker>("localePicker");
                if (this.localePicker == null)
                {
                    return;
                }

                this.localePicker.SelectedIndex         = 0;
                this.localePicker.SelectedIndexChanged += this.LocalePicker_SelectedIndexChanged;
                this.schedule.DataSource = this.localizationViewModel.JapaneseAppointments;
            }

            this.viewPicker = bindable.FindByName <Picker>("viewPicker");

            if (this.viewPicker == null)
            {
                return;
            }

            if (bindable.GetType().Equals(typeof(RecursiveAppointments)))
            {
                this.viewPicker.SelectedIndex = 3;
                switch (Device.RuntimePlatform)
                {
                case Device.iOS:
                    this.schedule.MonthViewSettings.AppointmentDisplayMode = AppointmentDisplayMode.Appointment;
                    if (Device.RuntimePlatform == Device.iOS && Device.Idiom == TargetIdiom.Tablet)
                    {
                        schedule.MonthViewSettings.AppointmentIndicatorCount = 4;
                    }
                    else if (Device.RuntimePlatform == Device.iOS)
                    {
                        schedule.MonthViewSettings.AppointmentIndicatorCount = 2;
                    }
                    break;

                case Device.Android:
                    this.schedule.MonthViewSettings.AppointmentDisplayMode = AppointmentDisplayMode.Appointment;
                    break;

                case Device.UWP:
                    this.schedule.MonthViewSettings.AppointmentDisplayMode = AppointmentDisplayMode.Indicator;
                    break;

                case Device.WPF:
                    this.schedule.MonthViewSettings.AppointmentDisplayMode = AppointmentDisplayMode.Indicator;
                    break;
                }
            }
            else if (bindable.GetType().Equals(typeof(ViewCustomization)))
            {
                this.viewPicker.SelectedIndex = 3;
            }
            else if (bindable.GetType().Equals(typeof(Localization)))
            {
                this.schedule.MonthViewSettings.AppointmentDisplayMode  = AppointmentDisplayMode.Appointment;
                this.schedule.MonthViewSettings.AppointmentDisplayCount = 2;
                if (Device.RuntimePlatform == Device.iOS && Device.Idiom == TargetIdiom.Tablet)
                {
                    schedule.MonthViewSettings.AppointmentIndicatorCount = 4;
                }
                else if (Device.RuntimePlatform == Device.iOS)
                {
                    schedule.MonthViewSettings.AppointmentIndicatorCount = 2;
                }

                this.viewPicker.SelectedIndex = 3;
            }
            else
            {
                switch (Device.RuntimePlatform)
                {
                case Device.iOS:
                    schedule.ScheduleView = ScheduleView.MonthView;
                    if (Device.Idiom == TargetIdiom.Tablet)
                    {
                        schedule.MonthViewSettings.AppointmentIndicatorCount = 4;
                    }
                    else
                    {
                        schedule.MonthViewSettings.AppointmentIndicatorCount = 2;
                    }

                    this.viewPicker.SelectedIndex = 3;
                    break;

                case Device.Android:
                    schedule.ScheduleView         = ScheduleView.MonthView;
                    this.viewPicker.SelectedIndex = 3;
                    break;

                case Device.UWP:
                    schedule.ScheduleView         = ScheduleView.WeekView;
                    this.viewPicker.SelectedIndex = 1;
                    break;

                case Device.WPF:
                    schedule.ScheduleView         = ScheduleView.WeekView;
                    this.viewPicker.SelectedIndex = 1;
                    break;
                }
            }

            if (bindable.GetType().Equals(typeof(GettingStarted)))
            {
                schedule.ScheduleView         = ScheduleView.WeekView;
                this.viewPicker.SelectedIndex = 1;
                this.currentTime.Toggled     += CurrentTime_Toggled;

                switch (Device.RuntimePlatform)
                {
                case Device.iOS:
                    schedule.ShowAppointmentsInline = true;
                    break;

                case Device.Android:
                    schedule.ShowAppointmentsInline = true;
                    this.showCurrentTime.FontSize   = 18;
                    this.showCurrentTime.TextColor  = Color.Gray;
                    break;

                case Device.UWP:
                    schedule.ShowAppointmentsInline           = false;
                    schedule.MonthViewSettings.ShowAgendaView = false;
                    this.showCurrentTime.TextColor            = Color.Black;
                    break;

                case Device.WPF:
                    schedule.ShowAppointmentsInline           = false;
                    schedule.MonthViewSettings.ShowAgendaView = false;
                    break;
                }
            }

            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
        }
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            this.schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");
            if (Device.RuntimePlatform == Device.UWP || Device.RuntimePlatform == Device.WPF)
            {
                this.schedule.TimeIntervalHeight = -1;
            }
            else if (Device.RuntimePlatform == "iOS")
            {
                this.schedule.TimeIntervalHeight = 80;
            }

            this.timelineViewSettings           = new TimelineViewSettings();
            this.timelineViewSettings.DaysCount = 7;
            this.SetDateFormat();
            this.schedule.ScheduleView     = ScheduleView.TimelineView;
            this.schedule.ResourceViewMode = ResourceViewMode.Absolute;
            this.schedule.ShowResourceView = true;
            if (Device.Idiom == TargetIdiom.Phone)
            {
                this.schedule.ResourceViewHeight = Device.RuntimePlatform == Device.iOS ? 75 : 100;
            }

            this.schedule.TimeInterval = 720;
            this.schedule.ViewHeaderStyle.DateFontSize = this.schedule.HeaderStyle.FontSize;
            this.schedule.TimelineViewSettings         = this.timelineViewSettings;
            if (Device.RuntimePlatform == Device.Android)
            {
                this.schedule.ViewHeaderHeight = 70;
            }
            else if (Device.RuntimePlatform == Device.iOS)
            {
                this.schedule.ViewHeaderHeight = 30;
            }
            this.viewPicker = bindable.FindByName <Picker>("viewPicker");
            if (this.viewPicker == null)
            {
                return;
            }

            this.viewPicker.SelectedIndex         = 1;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;

            //this.viewModePicker = bindable.FindByName<Picker>("viewModePicker");
            //if (this.viewModePicker == null)
            //{
            //    return;
            //}

            //this.viewModePicker.SelectedIndex = 1;
            //this.viewModePicker.SelectedIndexChanged += OnViewModePickerSelectedIndexChanged;

            this.showResourceView = bindable.FindByName <Switch>("showResourceView");
            if (this.showResourceView == null)
            {
                return;
            }

            this.showResourceView.Toggled += OnShowResourceViewToggled;
        }
 protected override void OnDetachingFrom(SampleView bindable)
 {
     base.OnDetachingFrom(bindable);
     schedule = null;
 }
 /// <summary>
 /// Begins when the behavior attached to the view
 /// </summary>
 /// <param name="bindable">bindable value</param>
 protected override void OnDetachingFrom(SampleView bindable)
 {
     base.OnDetachingFrom(bindable);
     this.schedule.VisibleDatesChangedEvent -= this.Schedule_VisibleDatesChangedEvent;
     this.schedule = null;
 }
示例#27
0
        /// <summary>
        /// Begins when the behavior attached to the view
        /// </summary>
        /// <param name="bindable">bindable value</param>
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (bindable == null)
            {
                return;
            }

            base.OnAttachedTo(bindable);

            this.schedule = bindable.Content.FindByName <Syncfusion.SfSchedule.XForms.SfSchedule>("Schedule");
            if (Device.RuntimePlatform == "iOS")
            {
                this.schedule.TimeIntervalHeight = 80;
            }

            this.schedule.VisibleDatesChangedEvent += Schedule_VisibleDatesChangedEvent;
            this.schedule.TimelineViewSettings.AppointmentHeight = 1000;
            this.schedule.TimelineViewSettings.DaysCount         = 7;
            this.schedule.ScheduleView = ScheduleView.TimelineView;
            today = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 0, 0);
            this.schedule.MoveToDate = today;
            TimeRegionSettings timeRegionSettings = new TimeRegionSettings()
            {
                StartHour = 13,
                EndHour   = 14,
                Text      = "Lunch",
                TextColor = Color.Black,
                CanEdit   = false,
                Color     = Color.FromHex("#eaeaea")
            };

            TimeRegionSettings startRegionSettings = new TimeRegionSettings()
            {
                StartHour = 0,
                EndHour   = 9,
                Color     = Color.FromHex("#fafafa")
            };

            TimeRegionSettings endRegionSettings = new TimeRegionSettings()
            {
                StartHour = 18,
                EndHour   = 24,
                Color     = Color.FromHex("#fafafa")
            };

            this.schedule.SpecialTimeRegions = new System.Collections.ObjectModel.ObservableCollection <TimeRegionSettings>()
            {
                timeRegionSettings,
                startRegionSettings,
                endRegionSettings
            };

            this.viewPicker = bindable.FindByName <Picker>("viewPicker");
            if (this.viewPicker == null)
            {
                return;
            }

            this.viewPicker.SelectedIndex         = 1;
            this.viewPicker.SelectedIndexChanged += this.ViewPicker_SelectedIndexChanged;
        }