Guest User

Untitled

a guest
Jan 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. string path = string.Format("../ClientBin/{0}.xap", "catalogTesting");
  2. void MainPage_Loaded(object sender, RoutedEventArgs e)
  3. {
  4. LoadXapFile("catalogTesting");
  5. }
  6.  
  7. private void LoadXapFile(string name)
  8. {
  9. var catalog = new AggregateCatalog();
  10. try
  11. {
  12. CompositionHost.Initialize(new DeploymentCatalog(), catalog);
  13. CompositionInitializer.SatisfyImports(this);
  14. }
  15. catch (Exception)
  16. {
  17.  
  18. }
  19.  
  20. catalog.Catalogs.Add(CreateCatalog(name));
  21. }
  22.  
  23. private DeploymentCatalog CreateCatalog(string uri)
  24. {
  25. DeploymentCatalog catalog;
  26. catalog = new DeploymentCatalog(path + uri + @".xap");
  27. catalog.DownloadCompleted += (e, sa) =>
  28. {
  29.  
  30. };
  31. catalog.DownloadAsync();
  32. return catalog;
  33.  
  34. }
Add Comment
Please, Sign In to add comment