private void DeleteGame_OnClick(object sender, RoutedEventArgs e) { ModifyFile.RemoveGameFromFile(((Button)sender).Tag); try { ModifyFile.DeleteGameImages(((Button)sender).CommandParameter.ToString()); } catch (Exception exc) { Trace.WriteLine("Failed to delete images for game: " + exc); } string removeguid = ((Button)sender).Tag.ToString(); foreach (var item in ListViewModel.ListViewOC.ToList()) { if (removeguid == item.Guid) { Trace.WriteLine(DateTime.Now + ": Removed Game: " + item.Title); ListViewModel.ListViewOC.Remove(item); } } }
private void DeleteGame_OnClick(object sender, RoutedEventArgs e) { ModifyFile.RemoveGameFromFile(((Button)sender).Tag); ModifyFile.DeleteGameImages(((Button)sender).CommandParameter.ToString()); MainWindow.RefreshGames(); }