Beispiel #1
0
        private void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args)
        {
            foreach (var achievement in args.Achievements)
            {
                var category = AchievementsOrdered.FirstOrDefault(c => c.CategoryName == achievement.Category);
                if (category != null)
                {
                    category.Update(achievement);
                }
            }

            RaisePropertyChanged(OrderedAchievementsFieldName);
            RaisePropertyChanged(TotalCompletedFieldName);
            RaisePropertyChanged(PercentageCompletedFieldName);
        }
Beispiel #2
0
        private void AchievementContext_AchievementsUnlocked(object sender, AchievementEventArgs args)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() => notificationBox.ShowAchievements(args.UnlockedAchievements)));

            foreach (var achievement in args.UnlockedAchievements)
            {
                var currentAchievement = achievement;
                var category           = AchievementsOrdered.FirstOrDefault(c => c.CategoryName == currentAchievement.Category);
                if (category != null)
                {
                    category.Update(currentAchievement);
                }
            }

            RaisePropertyChanged(OrderedAchievementsFieldName);
            RaisePropertyChanged(TotalCompletedFieldName);
            RaisePropertyChanged(PercentageCompletedFieldName);
        }