public void Load(ShowTeamPostsToggleVisibilityMessage message) { if (Visibility == false) { NewestPosts.Clear(); //load new posts when updated var teamLight = facade.ConvertTeamModelToTeamLightModel(message.TeamModel); loadedTeam = facade.GetDetail(teamLight) as TeamModel; var newestPosts = facade.FindNewestNPostsInTeam(loadedTeam, PostsQuantity) .ToList(); NewestPosts.AddRange(newestPosts); //sort comments foreach (var post in NewestPosts) { post.Comments = post.Comments.OrderBy(c => c.Date).ToArray(); post.Comments = post.Comments.Take(CommentsQuantity).ToArray(); } loadedTeam = message.TeamModel; } else { loadedTeam = new TeamModel(); PostsQuantity = 2; CommentsQuantity = 1; } Visibility = !Visibility; }