public CommentView() { dt = new DispatcherTimer(); dt.Tick += new EventHandler(AutoRefresh); dt.Interval = new TimeSpan(0, 5, 0); dt.Start(); InitializeComponent(); comments = ClientRequests.getComments(); CommentList.ItemsSource = comments; }
private void banComment(object sender, RoutedEventArgs e) { if (CommentList.SelectedItem == null) { MessageBox.Show("Please select a comment to decline"); return; } ClientRequests.BanComment(comments.ElementAt(CommentList.SelectedIndex)); comments = ClientRequests.getComments(); CommentList.ItemsSource = comments; }
public void approveComment(object sender, RoutedEventArgs args) { if (CommentList.SelectedItem == null) { MessageBox.Show("Please select a comment to approve"); return; } ClientRequests.ApproveComment(comments.ElementAt(CommentList.SelectedIndex)); comments = ClientRequests.getComments(); CommentList.ItemsSource = comments; }
public void Refresh() { comments = ClientRequests.getComments(); CommentList.ItemsSource = comments; }