DevForce Help Reference
Add Method (CompositionHost)
Example 


Add dynamic content to the container.
Syntax
'Declaration
 
Public Shared Sub Add( _
   ByVal catalog As ComposablePartCatalog _
) 
'Usage
 
Dim catalog As ComposablePartCatalog
 
CompositionHost.Add(catalog)
public static void Add( 
   ComposablePartCatalog catalog
)

Parameters

catalog
Remarks
This can be used to add an AggregateCatalog or AssemblyCatalog to the composition container. The catalog is used to recompose the internal "parts" catalog. The Recomposed event is fired to indicate that dynamic content has been loaded.
Example
// If using MEF DeploymentCatalog, add to the DevForce CompositionHost after download.
public void AddXap(string uri) {
    DeploymentCatalog catalog;
    catalog = new DeploymentCatalog(uri);
    catalog.DownloadAsync();
    catalog.DownloadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(catalog_DownloadCompleted);
}

private void catalog_DownloadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) {
  IdeaBlade.Core.Composition.CompositionHost.Add(sender as DeploymentCatalog);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CompositionHost Class
CompositionHost Members

Send Feedback