private void AddHopsButton_Click(object sender, RoutedEventArgs e) { var w = new SelectHops(HopsRepo, BoilTime); w.ShowDialog(); if (w.hop != null) { BoilHops.Add(w.hop); var ol = BoilHops.OrderBy(x => x).ToList(); BoilHops.Clear(); foreach (HopAddition h in ol) hopsCompositionChanged(h); } }
private void HopsListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (HopsListView.SelectedIndex >= BoilHops.Count() || HopsListView.SelectedIndex < 0) return; var w = new SelectHops(HopsRepo, BoilHops.ToArray()[HopsListView.SelectedIndex]); w.ShowDialog(); if (w.hop != null) { BoilHops.Remove((HopAddition)HopsListView.SelectedItem); hopsCompositionChanged(w.hop); } }