/// <summary> /// Handles the AchievementsUnlocked event of the AchievementContext control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="args"> /// The <see cref="Strokes.Core.AchievementsUnlockedEventArgs"/> instance containing the event data. /// </param> private static void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args) { if (args.Achievements.Any()) { Debug.WriteLine(string.Format("Achievements unlocked: {0}", string.Join(", ", args.Achievements.Select(a => "[" + a.Name + "]")))); AchievementNotificationBox.ShowAchievements(args.Achievements); } }
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); }
private static void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args) { System.Console.WriteLine("Unlocked: " + string.Join(", ", args.Achievements.Select(a => a.Name))); }