private void Button_Click_Remove(object sender, RoutedEventArgs e) { if (ListBox_saved.SelectedValue == null) { return; } string item = ListBox_saved.SelectedValue.ToString(); Saved.Remove(item); ListBox_saved.UnselectAll(); saveToFile(); }