I'm trying a new approach to keeping my UI responsive while loading an large xps document. My button click starts my progress bar (loadStatus) I then start a new thread and call my "open and view document" method. The UI runs and the progress bar does it's thing but the xps document never displays. Before trying the code below, I ran the method on it's own right in the button click event and it works just fine. But as you know, the progress bar does nothing until the doc loads and is displayed. So, here is my code snippet, any ideas on what I may be doing wrong? I apologize in advance if I left anything out in my question post. Here's my code snippet:
private void maintBtn_TouchDown(object sender, TouchEventArgs e) // load and view maint manual
{
loadStatus.IsIndeterminate = true;
Thread thread = new Thread(getMaintDocument);
thread.Start();
}
private void getMaintDocument() // get and view the document
{
XpsDocument xpsDocument = new XpsDocument(@"Resources\maintManual.xps", FileAccess.Read);
documentViewer1.Dispatcher.Invoke(new Action(()=> xpsDocument.GetFixedDocumentSequence()) ,DispatcherPriority.Normal);
}