private void AddDriver(object sender, RoutedEventArgs e) { try { var driverPage = new AddOrUpdateDriver(); driverPage.CanLoad += Load; NavigationService.Navigate(driverPage); } catch (Exception ex) { MsgBox.Error(ex.Message); } }
private void UpdateDriver(object sender, RoutedEventArgs e) { try { if (DriverList.SelectedItem is driver driver) { var driverPage = new AddOrUpdateDriver(driver); driverPage.CanLoad += Load; NavigationService.Navigate(driverPage); } } catch (Exception ex) { MsgBox.Error(ex.Message); } }