private void Button_Click(object sender, RoutedEventArgs e) { DateTime date; Random r = new Random(); switch (r.Next(5)) { case 0: date = new DateTime(2013, 11, 21); break; case 1: date = new DateTime(2013, 11, 22); break; case 2: date = new DateTime(2013, 11, 23); break; case 3: date = new DateTime(2013, 11, 24); break; case 4: date = new DateTime(2013, 11, 25); break; case 5: date = new DateTime(2013, 11, 26); break; case 6: date = new DateTime(2013, 11, 27); break; default: date = new DateTime(2013, 11, 28); break; } ChartUtilities.UpdateCharts("g1", date); }
void MainWindow_KeyDown(object sender, KeyEventArgs e) { if (cbNavigate.IsChecked == true) { if (e.Key == Key.Right) { ChartUtilities.RightKeyPressed(); } if (e.Key == Key.Left) { ChartUtilities.LeftKeyPressed(); } } }