<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Dynamic load workspaces</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Dynamic load workspaces</description>
  <pubDate>Sat, 11 Apr 2026 02:03:23 -700</pubDate>
  <lastBuildDate>Sat, 13 Oct 2012 11:44:57 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3712</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Dynamic load workspaces : Here&amp;#039;s an example I wrote...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14836#14836</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3712<br /><strong>Posted:</strong> 13-Oct-2012 at 11:44am<br /><br />Here's an example I wrote a while back for a customer in Germany, so it's got some&nbsp;German&nbsp;comments in there. It's SL4, but I just updated it to the latest version of Cocktail.<div><br></div><div><a href="uploads/1005/Applicati&#111;nStarter.zip" target="_blank">uploads/1005/ApplicationStarter.zip</a><br></div>]]>
   </description>
   <pubDate>Sat, 13 Oct 2012 11:44:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14836#14836</guid>
  </item> 
  <item>
   <title>Dynamic load workspaces : Thank you Marcel,  Sounds logical. I&amp;#039;ve...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14835#14835</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=816" rel="nofollow">Peter</a><br /><strong>Subject:</strong> 3712<br /><strong>Posted:</strong> 13-Oct-2012 at 5:37am<br /><br />Thank you Marcel,<DIV>&nbsp;</DIV><DIV>Sounds logical.</DIV><DIV>I've added the following within the module.</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"><DIV>&#091;Export("MainViewModel", typeof(IWorkspace))&#093;</DIV><DIV>public class MainViewModel : Screen, IWorkspace, IDiscoverableViewModel</DIV><DIV>{</DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>But, OrganisationModuleFactory property is still&nbsp;throws a null exception.&nbsp;</DIV><DIV>Is there a complete example so I can compare my module.</DIV><DIV>I believe I'm forgetting something within my module implementation.&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Again, thank for your help.</DIV><DIV>&nbsp;</DIV><DIV>Peter</DIV>]]>
   </description>
   <pubDate>Sat, 13 Oct 2012 05:37:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14835#14835</guid>
  </item> 
  <item>
   <title>Dynamic load workspaces :   Peter,Your code above is looking...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14830#14830</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3712<br /><strong>Posted:</strong> 12-Oct-2012 at 11:55am<br /><br />Peter,<div>Your code above is looking for an export named "MainViewModel" and type IWorkspace. That doesn't match the ExportAttribute you have on your ViewModel. It should be like this:</div><div>&nbsp;</div><div>&#091;Export("MainViewModel", typeof(IWorkspace)&#093;</div>]]>
   </description>
   <pubDate>Fri, 12 Oct 2012 11:55:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14830#14830</guid>
  </item> 
  <item>
   <title>Dynamic load workspaces : Hello Cocktail colleague&amp;#039;s,  I&#226;&#8364;&#8482;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14829#14829</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=816" rel="nofollow">Peter</a><br /><strong>Subject:</strong> 3712<br /><strong>Posted:</strong> 12-Oct-2012 at 6:14am<br /><br /><DIV>Hello Cocktail colleague's,</DIV><DIV>&nbsp;</DIV><DIV>I’m writing my first cocktail Silverlight (SL5) application en getting familiair with MEF.<BR>So, I’m new to this.<BR><BR>I’m trying to dynamically load a IWorkspace ViewModel from a separate XAP file. I’m using the example found in the documentation. <BR>On the main SL application (the one loading a SSHBizzOrganisation module) I have the following code.<BR>Basically copied from the example.</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>&#091;Import("MainViewModel", AllowRecomposition = true, AllowDefault = true)&#093; </DIV><DIV>public ExportFactory&lt;IWorkspace&gt; OrganisationModuleFactory { get; set; }</DIV><DIV>&nbsp;</DIV><DIV>private IEnumerable&lt;INotifyCompleted&gt; ShowOrderDetail(OrganisationModuleMessage message) {</DIV><BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr><DIV>// Let's make sure the xap that contains the OrderEditor is loaded. </DIV><DIV>// Only the first call will load the xap, subsequent calls don't do anything. </DIV><DIV>yield return Composition.AddXapAsync("SSHBizzOrganisation.SL.xap");</DIV><DIV>// Now we can access the OrderEditorFactory. MEF recomposed this instance </DIV><DIV>// and provided us with an OrderEditorFactory. </DIV><DIV>var editor = OrganisationModuleFactory.CreateExport().Value;</DIV><DIV>var handler = editor as IHandle&lt;OrganisationModuleMessage&gt;; </DIV><DIV>if(handler != null) handler.Handle(message); </DIV></BLOCKQUOTE><DIV>}</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>When I run this, the AddXapAsync(..) call is working fine.<BR>But the ‘OrganisationModuleFactory’ property is always null.<BR>I’m sure I forgetting something here of within the module implementation.</DIV><DIV>The SSHBizzOrganisation module looks like this:</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>namespace SSHBizzOrganisation.ViewModels</DIV><DIV>{</DIV><BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr><DIV>&#091;Export(typeof(IWorkspace))&#093;</DIV><DIV>public class MainViewModel : Screen, IWorkspace, IDiscoverableViewModel</DIV><DIV>{</DIV><BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr><DIV>public MainViewModel()</DIV><DIV>{ // ReSharper disable DoNotCallOverridableMethodsInConstructor</DIV><DIV>DisplayName = "Desktop";</DIV><DIV>// ReSharper restore DoNotCallOverridableMethodsInConstructor</DIV></BLOCKQUOTE></BLOCKQUOTE><DIV>}</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>I have read some of the forum posts, but I probably missing some basic understanding.<BR>It’s not clear to me if I should use the PartFactory implementation or just use the &#091;Export&#093; attribute like I’ve done above. </DIV><DIV>I have tried both.</DIV><DIV>&nbsp;</DIV><DIV>Hope some can point me in the right direction.</DIV><DIV>Peter</DIV><DIV>　</DIV><DIV><BR></DIV>]]>
   </description>
   <pubDate>Fri, 12 Oct 2012 06:14:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3712&amp;PID=14829#14829</guid>
  </item> 
 </channel>
</rss>