Q: Can't update rich textbox from UI Thread..? I have this method that returns a FlowDocument.
    private static FlowDocument SortFriendsList()
    {
        FlowDocument DocumentToReturn = new FlowDocument();
        Paragraph CurrentParagraph = new Paragraph();
        #region Online status ellipse
        System.Windows.Shapes.Ellipse OnlineStatus = new System.Windows.Shapes.Ellipse();
        OnlineStatus.Height = 30;
        OnlineStatus.Width = 30;
        OnlineStatus.Stroke = System.Windows.Media.Brushes.Black;
        OnlineStatus.StrokeThickness = 1.5;
        OnlineStatus.Fill = System.Windows.Media.Brushes.Green;
        #endregion
        #region Offline status ellipse
        System.Windows.Shapes.Ellipse OfflineStatus = new System.Windows.Shapes.Ellipse();
        OfflineStatus.Height = 30;
        OfflineStatus.Width = 30;
        OfflineStatus.Stroke = System.Windows.Media.Brushes.Black;
        OfflineStatus.StrokeThickness = 1.5;
        OfflineStatus.Fill = System.Windows.Media.Brushes.Red;
        #endregion

        if (CurrentFriendsList.Count == 0)
        {
            Label TextToShow = new Label();
            TextToShow.FontSize = 16;
            TextToShow.Foreground = System.Windows.Media.Brushes.Black;
            TextToShow.Content = "Uh oh... It looks like you have no friends for now :(";
            CurrentParagraph.Inlines.Add(TextToShow);
            CurrentParagraph.Inlines.Add(Environment.NewLine);
            DocumentToReturn.Blocks.Add(StatusParagraph);
            return DocumentToReturn;
        }
        else
        {
            foreach (string Friend in CurrentFriendsList)
            {

                if (CurrentOnlineUsers.Contains(Friend))
                {

                    CurrentParagraph.Inlines.Add(OnlineStatus);
                }
                else
                {

                    CurrentParagraph.Inlines.Add(OfflineStatus);
                }
                #region Text to add after status ellipse
                Label TextToShow = new Label();
                TextToShow.FontSize = 16;
                TextToShow.Foreground = System.Windows.Media.Brushes.Black;
                TextToShow.Content = Friend;
                #endregion
                CurrentParagraph.Inlines.Add(TextToShow);
                CurrentParagraph.Inlines.Add(Environment.NewLine);
                DocumentToReturn.Blocks.Add(StatusParagraph);
            }
            return DocumentToReturn;
        }
    }

I'm calling the method like this to update the Rich textbox's document:
                App.Current.Dispatcher.Invoke(() => 
                {
                    try
                    {
                        WindowController.MainPage.FriendsListTextBox.Document = SortFriendsList();
                    }
                    catch (Exception Exc)
                    {
                        Console.WriteLine(Exc.ToString());
                    }
                });

However. For some reason I get

Exception thrown: 'System.InvalidOperationException' in WindowsBase.dll
System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.

The rich textbox is inside a tab item, I tried using it's dispatcher instead with no luck. I've tried the  page's, window's and rich textbox's dispatcher as well with no luck. Is there a way to find it's dispatcher? Maybe a method that return an array or list of all the dispatchers in the App.Current while trying to do dispatcher.checkaccess?
Thanks in advance :)

A: I ended up moving my method to App.xaml.cs and then called it with:
            App.Current.Dispatcher.Invoke(() => 
            {
                try
                {
                    WindowController.MainPage.FriendsListTextBox.Document = SortFriendsList();
                }
                catch (Exception Exc)
                {
                    Console.WriteLine(Exc.ToString());
                }
            });

