示例#1
0
        public void AddWhisper(Whisper whisper)
        {
            this.Dispatcher.Invoke(() => {
                _whispers.Add(whisper);

                if (IsLoaded)
                {
                    var border = (Border)VisualTreeHelper.GetChild(lbWhispers, 0);
                    var scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
                    scrollViewer.ScrollToBottom();

                    if (!whisper.IsSelf && !this.IsActive)
                    {
                        FlashWindow.Flash(this);
                    }
                }
            });
        }