Esempio n. 1
0
        void DoOnNewConversationItem(RosterItem item, bool bReceived, TextMessage msg)
        {
            if (item.JID.BareJID == OurRosterItem.JID.BareJID)
            {
                /// Clear our new message flag for this roster user as long as this window is open
                item.HasNewMessages = false;

                AddInlinesForMessage(msg);



                this.TextBlockChat.Focus();


                //TextPointer myTextPointer1 = MainParagraph.ContentStart.GetPositionAtOffset(20);
                //TextPointer myTextPointer1 = MainParagraph.ContentEnd.GetPositionAtOffset(0, LogicalDirection.Backward);
                //TextPointer myTextPointer2 = MainParagraph.ContentEnd.GetPositionAtOffset(0, LogicalDirection.Backward);
                this.TextBlockChat.Selection.Select(this.TextBlockChat.ContentEnd, this.TextBlockChat.ContentEnd);

                ScrollChat.ScrollToVerticalOffset(this.TextBlockChat.ActualHeight + 100);
                //this.ListBoxConversation.UpdateLayout();
                //if (this.ListBoxConversation.Items.Count > 0)
                //   this.ListBoxConversation.ScrollIntoView(this.ListBoxConversation.Items[this.ListBoxConversation.Items.Count - 1]);
            }
        }
Esempio n. 2
0
        void PushMessage(string a, string from)
        {
            a = a.Replace("<br />", "\r\n"); // chuyển đổi kí tự xuống dòng
            TextBlock tb = new TextBlock()
            {
                FontWeight = FontWeights.Bold,
                Text       = from + "\t\t\t\t" + DateTime.Now.ToLongTimeString() + "\n",
            };

            TextBlock tb1 = new TextBlock()
            {
                FontWeight = FontWeights.Normal,
                Text       = a,
            };

            TextBlock tb2 = new TextBlock()
            {
                FontWeight = FontWeights.Thin,
                Text       = "...................................................................................................................\n",
            };

            OpacityAnimation(tb, false, false, 1.5);
            OpacityAnimation(tb1, false, false, 1.5);
            OpacityAnimation(tb2, false, false, 1.5);

            ViewPanel.Children.Add(tb);
            ViewPanel.Children.Add(tb1);
            ViewPanel.Children.Add(tb2);
            ScrollChat.ScrollToEnd();
        }
Esempio n. 3
0
 private void ScrollRichTextBoxToBottom(object sender, EventArgs e)
 {
     ScrollChat.ScrollToVerticalOffset(this.TextBlockChat.ActualHeight + 100);
 }