title: "The calling thread must be STA, because many UI components require this." Error in WPF?
body: <p>I am creating a xps document as below.</p>
  
  <pre><code>Assembly assembly = Assembly.GetExecutingAssembly();
  //read embedded xpsDocument file
  Stream helpStream = assembly.GetManifestResourceStream(resourceNameOfContext);
  if (helpStream != null)
  {
      Package package = Package.Open(helpStream);
      string inMemoryPackageName = "memorystream://" + topicName + ".xps";
      Uri packageUri = new Uri(inMemoryPackageName);
      //Add package to PackageStore
      PackageStore.AddPackage(packageUri, package);
      docXps = new XpsDocument(package, CompressionOption.Maximum, inMemoryPackageName);
  }
  return docXps;
  </code></pre>
  
  <p>When i am trying to get docXps.GetFixedDocumentSequence();
  I am getting the above error. Can anyone help?</p>
  
  <p>Thanks,</p>