void OnPublicChat(string content, User user) { Run r = new Run(user.Name + ": " + content + "\n"); r.Foreground = Cartes.GetChatBrush(user.Name); if (Scroll.ScrollableHeight - Scroll.ExtentHeight < 5) { chat.Inlines.Add(r); Scroll.ScrollToEnd(); } else { chat.Inlines.Add(r); } }
public void AddUserText(string text, User user) { controller.AddText(text.LineBreak(), Cartes.GetChatBrush(user.Name)); AutoScroll(); }