public static void LoadPosts(this Panel i_Panel, FacebookObjectCollection <Post> i_PostCollection) { i_Panel.Invoke(new Action( () => { foreach (Post currentPost in i_PostCollection) { if (currentPost.Message != null) { UserControlPost post = new UserControlPost(currentPost); i_Panel.Controls.Add(post); post.Margin = new Padding(0, 0, 0, 30); } } })); }
public void getResPost(ObservableCollection <ViewModelJobPost> resPost) { StackPanelPost.Children.Clear(); BadgedNumPost.Badge = resPost.Count; foreach (var Post in resPost) { UserControlPost controlPost = new UserControlPost(this); controlPost.ToggleButtonShow.CommandParameter = Post.JobPostId; controlPost.TextBlockDate.Text = Post.Date.ToString(); controlPost.BadgedNumReact.Badge = Post.NumReact; //Age //WorkHour //Salary //Skills //More controlPost.TextBlockSpecification.Text = Post.Specification.Name; controlPost.TextBlockCompanyName.Text = Post.Company.Name; //hyper //controlPost.HyperlinkCompany.NavigateUri = Post.Company.Mail; //Field foreach (var category in Post.Categories) { Chip chipCategory = new Chip(); chipCategory.Content = category.Name; chipCategory.Margin = new Thickness(5, 0, 5, 5); controlPost.StackPanelCategory.Children.Add(chipCategory); } //JobPostAreaNums ,Area ,NumJob StackPanelPost.Children.Add(controlPost); // Box.Items.Add(controlPost); } }