public MainWindow() { InitializeComponent(); DateTime today = DateTime.Now; for (int i = 0; i < 7; i++) { if (today.AddDays(i).DayOfWeek != 0) { ReservationStatusPerDay fileInputBox1 = new ReservationStatusPerDay(today.AddDays(i)); scrollViewContentPanel.Children.Add(fileInputBox1); } } MainWindow_DatePicker.SelectedDate = today; ChangeModeButton.Click += new RoutedEventHandler(changeMode); readExcelFileButton.Click += new RoutedEventHandler(readExcelFile); AdminButtonPanel.Visibility = System.Windows.Visibility.Hidden; animationTimer.Interval = new TimeSpan(120); animationTimer.Tick += new EventHandler(MyTimer_Tick); button4.Click += new RoutedEventHandler(Button_Click); }
private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { ReservationStatusPerDay child = scrollViewContentPanel.Children.OfType <ReservationStatusPerDay>().FirstOrDefault(); reservationStatusPerDayWidth = child.ActualWidth; animationTimer.Start(); deltaDirection = (e.Delta < 0) ? 2 : -2; delta = 0; startPos = ScrollViewer.HorizontalOffset; e.Handled = true; }