<?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 : Cocktail 2012 - IWorkspace  Why that change</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Cocktail 2012 - IWorkspace  Why that change</description>
  <pubDate>Fri, 10 Apr 2026 20:07:05 -700</pubDate>
  <lastBuildDate>Wed, 26 Sep 2012 12:02:39 -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=3668</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>Cocktail 2012 - IWorkspace  Why that change :   You can still dynamically...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3668&amp;PID=14617#14617</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> 3668<br /><strong>Posted:</strong> 26-Sep-2012 at 12:02pm<br /><br />You can still dynamically add workspaces, but IWorkspace is no longer automatically exported in TempHire. The change above is due to how the Navigator works in Cocktail 2. You no longer navigate to an instance of a ViewModel. You navigate to a ViewModel type. <div>&nbsp;</div><div>So, therefore IWorkspace was changed to return the associated VM type for the navigator. Because I only have two workspaces in TempHire I decided to statically add them directly to the container instead of creating Workspace classes that are exported. </div><div>&nbsp;</div><div>The workspace is basically just a lightweight proxy now that knows the type of the ViewModel that implements the actual workspace. The shell grabs the type from the Workspace and navigates to it, so the VM and all it's dependencies are&nbsp;not instantiate until you navigate to the workspace.</div><div>&nbsp;</div><div>In your case you have to create a class for each workspace and export it as IWorkspace, so that it gets discovered when you load the xap.</div><div>&nbsp;</div><div>So, for example I could have done the following instead of adding the home workspace via the CompositionBatch.</div><div><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"></font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font>&nbsp;</div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">&nbsp;&nbsp;&nbsp; &#091;Export(typeof(IWorkspace))&#093;<br>&nbsp;&nbsp;&nbsp; public class HomeWorkspace : Workspace<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public HomeWorkspace() : base("Home", true, 0, typeof (HomeViewModel))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br></div><p>&nbsp;</p></font></font>]]>
   </description>
   <pubDate>Wed, 26 Sep 2012 12:02:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3668&amp;PID=14617#14617</guid>
  </item> 
  <item>
   <title>Cocktail 2012 - IWorkspace  Why that change :   HiI was using IWorkspace to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3668&amp;PID=14608#14608</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1514" rel="nofollow">halloweenx8</a><br /><strong>Subject:</strong> 3668<br /><strong>Posted:</strong> 26-Sep-2012 at 8:02am<br /><br />Hi<div>&nbsp;</div><div>I was using IWorkspace to dyamically create menu items after loading a XAP</div><div>&nbsp;</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>Composition.AddXapAsync("dymanicMenu.xap");</em></div><div>&nbsp;</div><div>But it does not work anymore</div><div>&nbsp;</div><div>Why the change to </div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em> protected override void PrepareCompositionContainer(CompositionBatch batch)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.PrepareCompositionContainer(batch);</em></div><div><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Configure workspaces<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;IWorkspace&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new Workspace("Home", true, 0, typeof (HomeViewModel)));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; batch.AddExportedValue&lt;IWorkspace&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new Workspace("Resource Management", false, 10, typeof (ResourceMgtViewModel)));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br></em></div><div>How do you now dynamically add workspaces, in my case I adding a XAP with a workpace in it would have done the trick, how do I do that with Cocktail 2?</div><div>&nbsp;</div><div>Thanks</div>]]>
   </description>
   <pubDate>Wed, 26 Sep 2012 08:02:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3668&amp;PID=14608#14608</guid>
  </item> 
 </channel>
</rss>