private void Cal_SelectedTimeChanged(object sender, MahApps.Metro.Controls.TimePickerBaseSelectionChangedEventArgs <TimeSpan?> e) { if (cal.SelectedDate != null) { Date = (DateTime)cal.SelectedDate - DateTime.Now; DateTime dateTime = DateTime.Now.Add(Date); box.Text = (dateTime).ToShortDateString() + " " + dateTime.ToShortTimeString(); IOData.EcrireDate(Date); } }
private void Cb_Click(object sender, RoutedEventArgs e) { if ((bool)cb.IsChecked) { Date = new TimeSpan(0, 0, 0); cal.IsEnabled = false; DateTime dateTime = DateTime.Now; box.Text = (dateTime).ToShortDateString() + " " + dateTime.ToShortTimeString(); IOData.EcrireDate(Date); } else { cal.IsEnabled = true; } }