I am clearing content from FlowDocument using Dispatcher.The code is in non UI assembly. The code is
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
new Action(delegate()
{
_flowDocument.Blocks.Clear();
}
However I am facing null reference exception whenever this code executes.
Well I already have a thread (forgot about it while posting the question) to perform operations on FlowDocument, So I just need to call the above mentioned code using a delegate .