private void ButtonRemove_Click(object sender, RoutedEventArgs e) { if (lstBoxCurrDonations.SelectedIndex == -1) { MessageBox.Show("Please select an order"); } else { String c1 = lstBoxCurrDonations.SelectedItem as String; foreach (Pedido p in restaurante.pedidosRestaurante) { if (c1.Equals(p.withCodeString())) { restaurante.pedidosRestaurante.Remove(p); CurrentDonations cd = new CurrentDonations(restaurante); this.NavigationService.Navigate(cd); break; } } } }
private void ButtonCurrentDoantions_Click(object sender, RoutedEventArgs e) { CurrentDonations currDonations = new CurrentDonations(restaurante); this.NavigationService.Navigate(currDonations); }