Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string path = string.Format("../ClientBin/{0}.xap", "catalogTesting");
- void MainPage_Loaded(object sender, RoutedEventArgs e)
- {
- LoadXapFile("catalogTesting");
- }
- private void LoadXapFile(string name)
- {
- var catalog = new AggregateCatalog();
- try
- {
- CompositionHost.Initialize(new DeploymentCatalog(), catalog);
- CompositionInitializer.SatisfyImports(this);
- }
- catch (Exception)
- {
- }
- catalog.Catalogs.Add(CreateCatalog(name));
- }
- private DeploymentCatalog CreateCatalog(string uri)
- {
- DeploymentCatalog catalog;
- catalog = new DeploymentCatalog(path + uri + @".xap");
- catalog.DownloadCompleted += (e, sa) =>
- {
- };
- catalog.DownloadAsync();
- return catalog;
- }
Add Comment
Please, Sign In to add comment