Esempio n. 1
0
        private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            GridLength             hourHeaderSize = (GridLength)this.FindResource("HourHeaderSize");
            SchedulerWeekViewModel viewModel      = (SchedulerWeekViewModel)DataContext;

            viewerBody.ScrollToVerticalOffset(hourHeaderSize.Value * viewModel.TopDisplayedHour);
        }
Esempio n. 2
0
        private void CreateViewModel(DisplayMode displayMode, DateTime date)
        {
            lock (this)
            {
                switch (displayMode)
                {
                case DisplayMode.Day:
                    ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.Day);
                    break;

                case DisplayMode.WorkWeek:
                    ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.WorkWeek);
                    break;

                case DisplayMode.Week:
                    ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.Week);
                    break;

                case DisplayMode.Month:
                    ViewModels[(int)displayMode] = new SchedulerMonthViewModel(this, occurrences);
                    break;
                }
                if (ViewModels[(int)displayMode] != null)
                {
                    ViewModels[(int)displayMode].Initialize(date);
                }
            }
        }
Esempio n. 3
0
 private void CreateViewModel(DisplayMode displayMode, DateTime date)
 {
     lock (this)
     {
         switch (displayMode)
         {
             case DisplayMode.Day:
                 ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.Day);
                 break;
             case DisplayMode.WorkWeek:
                 ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.WorkWeek);
                 break;
             case DisplayMode.Week:
                 ViewModels[(int)displayMode] = new SchedulerWeekViewModel(this, occurrences, DisplayedDays.Week);
                 break;
             case DisplayMode.Month:
                 ViewModels[(int)displayMode] = new SchedulerMonthViewModel(this, occurrences);
                 break;
         }
         if (ViewModels[(int)displayMode] != null)
             ViewModels[(int)displayMode].Initialize(date);
     }
 }