public void DoneClicked(object param) { var newRewards = RewardsAdded.Where(r => !tracker.Rewards.Contains(r)); //fix up excaly same date DateTime date = trackerFactory.GetDateTimeNow(); foreach (Reward r in newRewards) { r.Date = date; r.ArenaDeck = ArenaDeck; } trackerFactory.GetTracker().Rewards.AddRange(newRewards); trackerFactory.GetFileManager().SaveDatabase(); rewards.Clear(); RewardsEditor.Clear(); RewardReason = null; RefreshRewardLists(); }
public void DoneClicked(object param) { var newRewards = RewardsAdded.Where(r => !tracker.Rewards.Contains(r)); //fix up excaly same date DateTime date = trackerFactory.GetDateTimeNow(); foreach (Reward r in newRewards) { r.Date = date; r.ArenaDeck = ArenaDeck; } trackerFactory.GetTracker().Rewards.AddRange(newRewards); trackerFactory.GetFileManager().SaveDatabase(); rewards.Clear(); rewards = new PropertiesObservableCollection <Reward>(CreateEmptySet(), Rewards_CollectionChanged); RewardReason = null; RefreshRewardLists(); }