//Add a car hire to the current booking private void AddCarHireBtn_Click(object sender, RoutedEventArgs e) { CarHireWindow win = new CarHireWindow(); win.StartDatePicker.Focusable = true; win.EndDatePicker.Focusable = true; win.DriverBox.IsReadOnly = false; win.ShowDialog(); //Any car hire related logic is handled in the CarHireWindow class }
//View the currently selected Car_Hire private void ViewCarHireBtn_Click(object sender, RoutedEventArgs e) { CarHire hire = CarHireListBox.SelectedItem as CarHire; CarHireWindow win = new CarHireWindow(); win.StartDatePicker.DisplayDate = hire.StartDate; win.EndDatePicker.DisplayDate = hire.EndDate; win.DriverBox.Text = hire.Driver; win.StartDatePicker.Focusable = false; win.EndDatePicker.Focusable = false; win.DriverBox.IsReadOnly = true; }