示例#1
0
 /// <summary>
 /// Clear the chat history
 /// </summary>
 public override void ClearChatHistory()
 {
     ChatHistory.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         ChatHistory.Text = "";
         ChatHistoryScroller.ScrollToVerticalOffset(ChatHistoryScroller.ScrollableHeight);
         ChatHistoryScroller.UpdateLayout();
     }).AsTask();
 }
示例#2
0
 /// <summary>
 /// Clear the chat history
 /// </summary>
 public override void ClearChatHistory()
 {
     ChatHistory.Dispatcher.BeginInvoke(new Action(() =>
     {
         ChatHistory.Text = "";
         ChatHistoryScroller.ScrollToVerticalOffset(ChatHistoryScroller.ScrollableHeight);
         ChatHistoryScroller.UpdateLayout();
     }));
 }
示例#3
0
 /// <summary>
 /// Add text to the chat history
 /// </summary>
 /// <param name="message"></param>
 public override void AppendLineToChatHistory(string message)
 {
     //To ensure we can succesfully append to the text box from any thread
     //we need to wrap the append within an invoke action.
     ChatHistory.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         ChatHistory.Text += message + "\n";
         ChatHistoryScroller.ScrollToVerticalOffset(ChatHistoryScroller.ScrollableHeight);
         ChatHistoryScroller.UpdateLayout();
     }).AsTask();
 }
示例#4
0
 /// <summary>
 /// Add text to the chat history
 /// </summary>
 /// <param name="message"></param>
 public override void AppendLineToChatHistory(string message)
 {
     //To ensure we can successfully append to the text box from any thread
     //we need to wrap the append within an invoke action.
     ChatHistory.Dispatcher.BeginInvoke(new Action <string>((messageToAdd) =>
     {
         ChatHistory.Text += messageToAdd + "\n";
         ChatHistoryScroller.ScrollToVerticalOffset(ChatHistoryScroller.ScrollableHeight);
         ChatHistoryScroller.UpdateLayout();
     }), new object[] { message });
 }