public static void ExitGame() { var allEntities = EntitiesRunner.Current.GetAllEntities(); foreach (Entity entity in allEntities) { entity.IsActive = false; } AppWindow.CloseAfterFrame(); }