private void Action_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; string Tooltip = button.ToolTip as string; string content = Tooltip.Split(' ')[0]; if (content.Equals("Reply")) { InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel; _instInteractionModel.CanComment = false; id = button.Tag as string; Reply.Focus(); } else if (content.Equals("Delete")) { id = button.Tag as string; InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel; _instInteractionModel.DeleteReply(id); } else if (content.Equals("Hide")) { id = button.Tag as string; InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel; _instInteractionModel.HideReply(id); } else if (content.Equals("Send")) { InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel; bool outcome = _instInteractionModel.PushReply(id, Reply.Text); if (outcome) { System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new System.Action(() => { if (ReplyList.Items != null && ReplyList.Items.Count > 0) { ReplyList.ScrollIntoView(ReplyList.Items[ReplyList.Items.Count - 1]); } })); _instInteractionModel.CanComment = true; Reply.Text = "Enter reply here..."; } } }
private void Close_Click(object sender, RoutedEventArgs e) { InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel; _instInteractionModel.CanComment = true; }