예제 #1
0
        void AddItem(ChatItem item)
        {
            bool gotoEnd = ScrollBar.VerticalOffset == ScrollBar.ScrollableHeight;

            if (gotoEnd)
            {
                while (Messages.Count >= 250)
                {
                    Messages.RemoveAt(0);
                }
            }

            Messages.Add(item);

            if (gotoEnd)
            {
                ScrollBar.ScrollToEnd();
            }
        }
예제 #2
0
        void AddItem(ChatItem item)
        {
            bool gotoEnd = ScrollBar.VerticalOffset == ScrollBar.ScrollableHeight;

            while (Messages.Count >= 250)
                Messages.RemoveAt(0);

            Messages.Add(item);

            if (gotoEnd)
                ScrollBar.ScrollToEnd();
        }