private void EditItemsMenuItem_Click(object sender, RoutedEventArgs e) { if (smartphonesListBox.SelectedItem != null) { var editWindow = new EditSelectedItems((Smartphone)smartphonesListBox.SelectedItem); bool?result = editWindow.ShowDialog(); //if(result==true) // smartphonesListBox. } }
private void AddMenuItem_OnClick(object sender, RoutedEventArgs e) { var sp = new Smartphone("", ""); var editWindow = new EditSelectedItems(sp); bool?result = editWindow.ShowDialog(); if (result == true) { _smartphones.Add(sp); } }