<?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 : Attempting to mock data at *design* time</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Attempting to mock data at *design* time</description>
  <pubDate>Wed, 13 May 2026 00:12:45 -700</pubDate>
  <lastBuildDate>Mon, 26 Dec 2011 23:38:20 -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=2076</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>Attempting to mock data at *design* time :   Interesting - I had installed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12316#12316</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=683" rel="nofollow">Wayne</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 26-Dec-2011 at 11:38pm<br /><br />Interesting - I had installed Silverlight 5 but then uninstalled it and went back to Silverlight 4 on this development machine.<div>&nbsp;</div><div>Additional - while stepping though each line after asking Blend to open User Control for designing -</div><div>&nbsp;</div><div>IdeaBlade.Core.<span>IdeaBladeConfig</span>.Instance.ProbeAssemblyNames.Add(<span style="color: blue;">typeof</span>(<span>NorthwindIBEntities</span>).Assembly.FullName);<br></div><div>is the first line of code that fails (subsequent&nbsp; deserialization also fails) - but executing the code to use the design data during a regular run&nbsp;and stepping though the code - that line resolves the conflict, succeeds and the cached data load properly.</div><div>&nbsp;</div><div>I will look into the possibility&nbsp;are some left overs of Silverlight 5 after reverting back&nbsp;to Silverlight 4.</div><div>&nbsp;</div><div>Is there an example&nbsp;of the "Data Mother" class available that you could share &gt;</div><div>&nbsp;</div><div>Thank you for your help.</div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Mon, 26 Dec 2011 23:38:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12316#12316</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time :  Are you sure about the cause...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12315#12315</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 26-Dec-2011 at 9:53pm<br /><br />Are you sure about the cause that you have identified? Could it be a null exception encountered during deserialization.Have you loaded Silverlight 5 by chance? <div></div>I ask because there is a critical serialization bug in the Silverlight 5 release (RTW) acknowledged by Microsoft; apparently they took a dependence on a serialization method that does not exist in desktop .NET 4. "So what?" Well both Cider and Blend are actually running desktop .NET 4 when they display your Silverlight XAML. Too bad for all of us; serialization does not work.<div>&nbsp;</div><div>Microsoft has no intention of "fixing" SL 5 to address this. They have advised us that the developer should either revert to SL 4 (remove all SL 5 from the machine) or hang on for .NET 4.5; you can try a CTP of .NET 4.5.</div><div>&nbsp;</div><div>Frankly, we don't think any of these workarounds are appropriate. We are trying to find something else to recommend; no luck so far.</div><div>&nbsp;</div><div>It doesn't look good for designing with data that has been restored from an Entity Cache file ... or for any tactic that involves (de)serialization.</div><div>&nbsp;</div><div>For now we suggest that you create design data dynamicall with a "Data Mother" class: a class that instantiates design-time entities and populates an offline EntityManager; these become the data source for design time data binding.</div><div>&nbsp;</div><div>We regret the (temporary) loss of the entity cache file feature. I wish we knew a way around it. I'll certainly let you know if we come up with something.</div><div>&nbsp;</div><div>Root for .NET 4.5 I guess.</div><div>&nbsp;</div><div>If this is not the immediate cause of your problem and you are willing to live entirely in SL 4, please post again with more detail and we can get you going.</div>]]>
   </description>
   <pubDate>Mon, 26 Dec 2011 21:53:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12315#12315</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time :   Following this thread with...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12314#12314</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=683" rel="nofollow">Wayne</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 26-Dec-2011 at 2:23pm<br /><br />Following this thread with version 6.1.3 in a Silverlight app - loading from cache works fine at runtime but in Blend (design time)&nbsp;this line now&nbsp;seems to cause a failure:<div><pre style=": white; color: black; font-family: C&#111;nsolas;">IdeaBlade.Core.<span style="color: rgb43, 145, 175;">IdeaBladeConfig</span>.Instance.ProbeAssemblyNames.Add(<span style="color: blue;">typeof</span>(<span style="color: rgb43, 145, 175;">NorthwindIBEntities</span>).Assembly.FullName);</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">Debugging Blend design time with VS2010 - Blend cannot seem to figure out whether to add the assembly name to </pre><pre style=": white; color: black; font-family: C&#111;nsolas;">IdeaBlade.Core or IdeaBlade.Core.SL (common names inside)</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">So the line fails and so then </pre><pre style=": white; color: black; font-family: C&#111;nsolas;"><span style="color: rgb43, 145, 175;">EntityCacheState</span>.Restore(res.Stream) </pre><pre style=": white; color: black; font-family: C&#111;nsolas;">fails too with null exceptions for each field and record during the load.</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">Is there a work-around to add the assembly full names ?</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">Thank you in advance.</pre><pre style=": white; color: black; font-family: C&#111;nsolas;">&nbsp;</pre><pre style=": white; color: black; font-family: C&#111;nsolas;"> </pre><pre style=": white; color: black; font-family: C&#111;nsolas;">&nbsp;</pre></div>]]>
   </description>
   <pubDate>Mon, 26 Dec 2011 14:23:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=12314#12314</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : thanks Ward, that did the trick...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9312#9312</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=764" rel="nofollow">mikedfox</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 06-Dec-2010 at 10:46am<br /><br />thanks Ward, that did the trick]]>
   </description>
   <pubDate>Mon, 06 Dec 2010 10:46:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9312#9312</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : @Mike - I posted an update to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9309#9309</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 05-Dec-2010 at 10:15am<br /><br />@Mike - I posted an update to our BookShelf sample application so that it now uses an EntityCacheState for design time data. The zip includes a long document with a chapter on this subject. Find it at <a href="http://www.ideablade.com/BookShelfDF/BookShelfDF.zip." target="_blank">http://www.ideablade.com/BookShelfDF/BookShelfDF.zip.</A> I&nbsp;just <a href="http://neverindoubtnet.blogspot.com/2010/12/design-with-database-data-in-devforce.html" target="_blank">posted</A> that chapter in my blog. <DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>You get that serialization error because DevForce can't find your entity model while in the designers. I don't know yet&nbsp;why we can't find it and I'm going to get to the bottom of that question. Meanwhile, the workaround is simple: tell DevForce where to find your model assembly ... which you do with a line such as follows. You must&nbsp;execute&nbsp;it BEFORE creating any EntityManager:</DIV><DIV>&nbsp;</DIV><DIV><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA">&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;Register&nbsp;the&nbsp;model's&nbsp;assembly&nbsp;name&nbsp;among&nbsp;probed&nbsp;assemblies</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;Must&nbsp;be&nbsp;called&nbsp;BEFORE&nbsp;the&nbsp;first&nbsp;EM&nbsp;creation&nbsp;else</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: green">//&nbsp;fails&nbsp;w/&nbsp;deserialization&nbsp;exception</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;IdeaBlade.Core.<SPAN style="COLOR: #2b91af">IdeaBladeConfig</SPAN>.Instance.ProbeAssemblyNames<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Add(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">BookClubEntities</SPAN>).Assembly.FullName);</SPAN></DIV><DIV><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA"><DIV>&nbsp;</DIV><DIV>The "BookClubEntities" class happens to be the specialized EntityManager defined in the application model; any class from that model would do for finding the model assembly.</DIV></SPAN></DIV><span style="font-size:10px"><br /><br />Edited by WardBell - 05-Dec-2010 at 11:25am</span>]]>
   </description>
   <pubDate>Sun, 05 Dec 2010 10:15:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9309#9309</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Mike - I am at Firestarter today...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9300#9300</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 02-Dec-2010 at 1:50pm<br /><br />Mike - I am at Firestarter today so can't look at it this second. I take it you are not creating and attaching entities in code but, rather, trying to import them into the Design Entity Manager cache. I will look at this when I get back.]]>
   </description>
   <pubDate>Thu, 02 Dec 2010 13:50:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9300#9300</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Ward, this still seems to be broken....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9299#9299</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=764" rel="nofollow">mikedfox</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 02-Dec-2010 at 12:50pm<br /><br />Ward, this still seems to be broken. I'm adapting your recent clientui example and when I try to add items to my design time data manager using load cache, I get an error in serialization. It says that there are unknown types. At runtime, the same load from cache works.<DIV>&nbsp;</DIV><DIV>As an alternate, I tried manually creating some sample data, but get an error trying to add entities with an identity key. Its looking for an idgenerator, even though at runtime it works.</DIV><DIV>&nbsp;</DIV><DIV>I have 6.0.6.1</DIV>]]>
   </description>
   <pubDate>Thu, 02 Dec 2010 12:50:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=9299#9299</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Update: We reproduced your case,found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8331#8331</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 02-Sep-2010 at 7:54pm<br /><br />Update: We reproduced your case,&nbsp;found the obstacle to deserializing the cache while in Blend or Cider, and we have a fix. Unfortunately, the obstacle remains in 6.0.5.<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>I'm hoping myself to get an early 6.0.6 to try out the fix. Perhaps you can wait another 6 or 7 weeks for the official 6.0.6 ... although I'll be happy to send you an EAP of 6.0.6 as soon as we feel even slighly comfortable with it.</DIV><DIV>&nbsp;</DIV><DIV>Thanks for driving hard on this issue.&nbsp; That just makes the product better.</DIV>]]>
   </description>
   <pubDate>Thu, 02 Sep 2010 19:54:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8331#8331</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Hi Jason - I did look into it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8311#8311</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 01-Sep-2010 at 1:31am<br /><br />Hi Jason - I did look into it ASAP. The kiosk app I demonstrated at DevConnections in April only works because I can save to cache and restore from cache.<DIV>&nbsp;</DIV><DIV>Now that app did not work in design mode at the time because there were gremlins in VS and Blend and in DevForce that worked against it. I must have missed the "design mode" component of your post. It would help if you said "Blend" a few hundred more times so I wouldn't miss it :-)</DIV><DIV>&nbsp;</DIV><DIV>I haven't had time to see if there are challenges going the next step and working with cached data in a design time VM consumed in Blend (or Cider).</DIV><DIV>&nbsp;</DIV><DIV>I've been living in 6.0.5 for what seems like forever (6 or 7 weeks is "forever" around here) so I'm not sure if the version upgrade will relieve your troubles.</DIV><DIV>&nbsp;</DIV><DIV>If you have something that fails, I'd be happy to check it out. Can you send me a small Northwind example? I'd be much obliged. Otherwise, I'll have to put this off for at least two weeks.</DIV><DIV>&nbsp;</DIV><DIV>p.s.: trust the move went well and you haven't locked yourself out of the house yet.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 01 Sep 2010 01:31:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8311#8311</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Sorry, been moving house over...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8310#8310</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 01-Sep-2010 at 12:28am<br /><br />Sorry, been moving house over the weekend so haven't been coding for a few days...<br><br>Not quite sure about this comment:<br><br><b><i>Hmmm .... we will look into this ASAP. The code snippet I gave you USED to work (6.0.3) but I haven't tried it recently. Maybe something happened. Will follow up. Didn't want you to feel lonely meanwhile.<br></i></b><br>Which code snippet are you referring to? The snippet you posted only saves the mock data, and there's no problem there; it's recreating the cache in design mode that breaks with internal null reference errors in all the tests I've done.<br><br>I'll check out the proper 6.05 when it's online, and see if anything has been magically fixed.<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Wed, 01 Sep 2010 00:28:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8310#8310</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : So ... if you still think you&amp;#039;re...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8187#8187</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 25-Aug-2010 at 11:33am<br /><br />So ... if you still think you're following the recipe and it still isn't working for you ... even with fresh DF 6.0.5 bits ... maybe you can code a little Northwindexample of what you are doing? That's something we could sink our teeth into. Thx.&nbsp;]]>
   </description>
   <pubDate>Wed, 25 Aug 2010 11:33:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8187#8187</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Perhaps you may take some comfort...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8185#8185</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 25-Aug-2010 at 11:17am<br /><br /><P>Perhaps you may take some comfort in this: I just ran the code and application from which I took that extract (above). Ran it on the nearly latests 6.0.5 bits ... after deleting old test data file and reconstructing ... and it all works ... on my machine&nbsp;:-)</P><DIV>That doesn't make it work on yours of course. At best it indicates that the process works SOMEWHERE on SOME VERSION of DevForce.</DIV><DIV>&nbsp;</DIV><DIV>Please check again that you are constructing the cache file with a Silverlight application.</DIV><DIV>&nbsp;</DIV><DIV>In early days, I tried to create the cache file with a Desktop client. I got the similar&nbsp;serialization failures. You have to build the cache file in an SL "DataMaker" app referencing the same Silverlight model &nbsp;that you will consume in your SL production app.</DIV><DIV>&nbsp;</DIV><DIV>You probably are doing exactly what I just said ... but I think it worth emphasizing because it is so easy to miss this distinction and sink into the morass (as I first did months ago).</DIV>]]>
   </description>
   <pubDate>Wed, 25 Aug 2010 11:17:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8185#8185</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Hmmm .... we will look into this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8182#8182</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 25-Aug-2010 at 9:11am<br /><br />Hmmm .... we will look into this ASAP. The code snippet I gave you USED to work (6.0.3) but I haven't tried it recently. Maybe something happened. Will follow up. Didn't want you to feel lonely meanwhile.]]>
   </description>
   <pubDate>Wed, 25 Aug 2010 09:11:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8182#8182</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Hi Ward, The generation and inclusion...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8172#8172</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 24-Aug-2010 at 6:14pm<br /><br />Hi Ward,<br>The generation and inclusion of the mock data in my test follows the same approach as yours, and I also include the mock data as a resource. I don't have any issue with this approach.<br><br>The code for restoring the cache is where my experiment fails:<br><font color="#000099">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var xx = new RiskStructureDB();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xx.DefaultQueryStrategy = QueryStrategy.CacheOnly;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream stream = Application.GetResourceStream(new Uri(@"RiskStructureEditor;component/MockData/mock.bin", UriKind.Relative)).Stream;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xx.CacheStateManager.RestoreCacheState(stream, RestoreStrategy.Normal, true);</font><br><br>This fails in 6.0.5 with the following exception:<br><br><font color="#000099">&nbsp;&nbsp; at IdeaBlade.EntityModel.DataSourceResolver.FindKey(String keyName, String keyExtension)<br>&nbsp;&nbsp; at IdeaBlade.EntityModel.DataSourceResolver.BuildRelatedInfo(String dataSourceKeyName, IIdGenerator idGenerator)<br>&nbsp;&nbsp; at IdeaBlade.EntityModel.DataSourceResolver.set_DataSourceInfoMap(Dictionary`2 value)<br>&nbsp;&nbsp; at ReadDataSourceResolverFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString&#091;&#093; , XmlDictionaryString&#091;&#093; )<br>&nbsp;&nbsp; at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract&amp; dataContract)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)<br>&nbsp;&nbsp; at ReadEntityCacheStateFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString&#091;&#093; , XmlDictionaryString&#091;&#093; )<br>&nbsp;&nbsp; at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract&amp; dataContract)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)<br>&nbsp;&nbsp; at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)<br>&nbsp;&nbsp; at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)<br>&nbsp;&nbsp; at IdeaBlade.EntityModel.SerializationFns.RestoreDCS(Type instanceType, Stream stream, Boolean closeOnExit, IEnumerable`1 knownTypes)<br>&nbsp;&nbsp; at IdeaBlade.EntityModel.EntityCacheState.Restore(Stream stream, Boolean closeOnExit)<br>&nbsp;&nbsp; at IdeaBlade.EntityModel.CacheStateManager.RestoreCacheState(Stream stream, RestoreStrategy strategy, Boolean closeOnExit)<br>&nbsp;&nbsp; at RiskStructureEditor.MainPageModel.LoadCacheState() in C:\Dev\RiskStructure\Silverlight\RiskStructureEditor\RiskStructureEditor\MainPage.model.cs:line 350</font><br><br>This appears to be related to the old issues of the DataSourceResolver serialization etc.<br>Any suggestions?<br>Once I get the cache retrieval working I'll happily join you in finding an elegant application of this approach :)<br>]]>
   </description>
   <pubDate>Tue, 24 Aug 2010 18:14:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8172#8172</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : @jsobell I invite you to improve...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8161#8161</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 24-Aug-2010 at 10:10am<br /><br />@jsobell I invite you to improve this approach and share with the rest of us!]]>
   </description>
   <pubDate>Tue, 24 Aug 2010 10:10:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8161#8161</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Glad to hear it&amp;#039;s working...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8160#8160</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 24-Aug-2010 at 10:04am<br /><br />Glad to hear it's working for you. 6.0.4 made a big difference in this regard.<DIV>&nbsp;</DIV><DIV>Not sure how quickly I can get to the example you want so let me give you some hints.</DIV><DIV>&nbsp;</DIV><DIV>You have to create the cache file from within a Silverlight Client. You'll be&nbsp;working with&nbsp;SILVERLIGHT types in your SL app so you have to populate your cache with the entities defined as the Silverlight types.</DIV><DIV>&nbsp;</DIV><DIV>Here is an&nbsp; extract from actually working, code-behind of a tiny SL app called KioskTestingDataMaker:</DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: blue"><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: blue">using</SPAN>&nbsp;System;<BR><SPAN style="COLOR: blue">using</SPAN>&nbsp;System.Windows;<BR><SPAN style="COLOR: blue">using</SPAN>&nbsp;System.Windows.Controls;<BR><SPAN style="COLOR: blue">using</SPAN>&nbsp;System.IO;</PRE></SPAN></PRE><BR><SPAN style="COLOR: blue">namespace</SPAN>&nbsp;Kiosk.Testing.DataMaker&nbsp;{<BR>&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">partial</SPAN>&nbsp;<SPAN style="COLOR: blue">class</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">MainPage</SPAN>&nbsp;:&nbsp;<SPAN style="COLOR: #2b91af">UserControl</SPAN>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;MainPage()&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">private</SPAN>&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;HandlePageLoaded(<SPAN style="COLOR: blue">object</SPAN>&nbsp;sender,&nbsp;<SPAN style="COLOR: #2b91af">RoutedEventArgs</SPAN>&nbsp;e)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataMaker&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">TestDataMaker</SPAN>();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataMaker.ReadyToWrite&nbsp;+=&nbsp;EnableSaveButton;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataMaker.Build();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">private</SPAN>&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;EnableSaveButton(<SPAN style="COLOR: blue">object</SPAN>&nbsp;sender,&nbsp;<SPAN style="COLOR: #2b91af">EventArgs</SPAN>&nbsp;args)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveButton.IsEnabled&nbsp;=&nbsp;<SPAN style="COLOR: blue">true</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTB.Text&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Cache&nbsp;data&nbsp;is&nbsp;ready;&nbsp;click&nbsp;SAVE&nbsp;button&nbsp;to&nbsp;save&nbsp;to&nbsp;local&nbsp;file&nbsp;system."</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">private</SPAN>&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;HandleSaveButtonClick(<SPAN style="COLOR: blue">object</SPAN>&nbsp;sender,&nbsp;<SPAN style="COLOR: #2b91af">RoutedEventArgs</SPAN>&nbsp;e)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTB.Text&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Save&nbsp;to&nbsp;the&nbsp;file&nbsp;named&nbsp;"</SPAN>+&nbsp;DataMaker.CacheFileName&nbsp;+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #a31515">"&nbsp;in&nbsp;the&nbsp;directory&nbsp;'Kiosk.Model.Testing.SL'."</SPAN>&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OpenSaveFileDialog();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">private</SPAN>&nbsp;<SPAN style="COLOR: blue">bool</SPAN>&nbsp;OpenSaveFileDialog()&nbsp;{<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">SaveFileDialog</SPAN>&nbsp;sfd&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">SaveFileDialog</SPAN>()&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DefaultExt&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"dat"</SPAN>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filter&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Data&nbsp;files&nbsp;(*.dat)|*.dat|All&nbsp;files&nbsp;(*.*)|*.*"</SPAN>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FilterIndex&nbsp;=&nbsp;1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">if</SPAN>&nbsp;(sfd.ShowDialog()&nbsp;==&nbsp;<SPAN style="COLOR: blue">true</SPAN>)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTB.Text&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Saving&nbsp;cache&nbsp;data&nbsp;to&nbsp;"</SPAN>&nbsp;+&nbsp;sfd.SafeFileName&nbsp;+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #a31515">"&nbsp;...&nbsp;please&nbsp;wait&nbsp;for&nbsp;next&nbsp;message&nbsp;..."</SPAN>;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">using</SPAN>&nbsp;(<SPAN style="COLOR: #2b91af">Stream</SPAN>&nbsp;stream&nbsp;=&nbsp;sfd.OpenFile())&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataMaker.WriteCacheToStream(stream);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stream.Close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTB.Text&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Saved&nbsp;test&nbsp;data&nbsp;to&nbsp;"</SPAN>&nbsp;+&nbsp;sfd.SafeFileName&nbsp;+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #a31515">"&nbsp;...&nbsp;You're&nbsp;done&nbsp;...&nbsp;close&nbsp;the&nbsp;application."</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;<SPAN style="COLOR: blue">true</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;statusTB.Text&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"You&nbsp;cancelled&nbsp;...&nbsp;cache&nbsp;data&nbsp;was&nbsp;not&nbsp;saved;&nbsp;you&nbsp;may&nbsp;close&nbsp;the&nbsp;app&nbsp;now."</SPAN>&nbsp;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;<SPAN style="COLOR: blue">false</SPAN>;<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">private</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">TestDataMaker</SPAN>&nbsp;DataMaker&nbsp;{&nbsp;<SPAN style="COLOR: blue">get</SPAN>;&nbsp;<SPAN style="COLOR: blue">set</SPAN>;&nbsp;}<BR>  <BR>&nbsp;&nbsp;}</PRE></DIV><DIV>The XAML that goes with it has a Save button and a TextBlock to show the instructions. Dumb and ugly as it comes.</DIV><DIV>&nbsp;</DIV><DIV>I leave as an exercise for you the implementation of&nbsp;the class called <SPAN style="COLOR: #2b91af">TestDataMaker</SPAN>. It's primary&nbsp;job is to query for the entities you want for your test into its EntityManager.</DIV><DIV>&nbsp;</DIV><DIV>The TestDataMaker app asks the user to identify where the file should be saved. That is because this app is a browser-based and must ask for permission. Were it out-of-browser with elevated permissions, it might do this without asking; I wrote this for SL 3 before elevated trust existed.</DIV><DIV>&nbsp;</DIV><DIV>The next challenge is to find and read the cache to load your test- or design-time EntityManager. I imagine there are many ways to do this. What I did was save the file to one of my Silverlight Testing projects. Everytime I run the DataMaker it replaces that file. Meanwhile, that file has a build action of 'Resource" in the test project. Resources are easy to read in Silverlight so my TestRepository has no trouble streaming in the Resource and loading the test EntityManager.</DIV><DIV>&nbsp;</DIV><DIV>You see the "write" side of this equation in the code above where I ask the user to save the file&nbsp;to a file with the name give&nbsp;by&nbsp;the DataMaker.CacheFileName property (e.g., "TestDataCache.dat"), located in&nbsp;the local&nbsp;file system folder, "Kiosk.Model.Testing.SL".</DIV><DIV>&nbsp;</DIV><DIV>Finally, you have to remember to rebuild the Kiosk.Model.Testing.SL&nbsp;test project so that it incorporates the revised resource file.</DIV><DIV>&nbsp;</DIV><DIV>The whole&nbsp;process is more baroque and manual than I would like. Fortunately, I don't have to re-make the test data very often. I can live with it.</DIV><DIV>&nbsp;</DIV><DIV>Btw, note that the resource file is checked in with the project ... so I've got my test data under source control :-/</DIV><DIV>&nbsp;</DIV><DIV>HTH</DIV>]]>
   </description>
   <pubDate>Tue, 24 Aug 2010 10:04:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8160#8160</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Hi Ward,We&amp;#039;ve been using...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8157#8157</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 24-Aug-2010 at 12:42am<br /><br />Hi Ward,<br>We've been using mocked entities in Blend without any problems, and it's really only the loading of cached data that we're missing. It's a pain creating mock objects, particularly when they involve tree structures :)<br>I'm looking forward to seeing what's in this cookbook though.<br>]]>
   </description>
   <pubDate>Tue, 24 Aug 2010 00:42:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8157#8157</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : We are well on our way to making...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8108#8108</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 20-Aug-2010 at 1:21am<br /><br /><P>We are well on our way to making DevForce play well with Blend. Actually, we probably are THERE. But we haven't documented it well and I don't feel that I'm particularly close to anything worthy of calling a "Best Practice." Let's say I have some "ok" practices :-/ </P><DIV>Here's visual evidence of an existence proof: yes, you&nbsp;truly can use a DevForce EntityManager and entities at design time:</DIV><DIV>&nbsp;</DIV><DIV><img src="http://www.ideablade.com/forum/uploads/482/SimpleComboBoxInBlend.png" height="371" width="618" border="0" alt="ComboBox Sample in Blend" title="ComboBox Sample in Blend" /></DIV><DIV>&nbsp;</DIV><DIV>This example comes from my slight re-design of the "Simple ComboBox in Silverlight" sample code. </DIV><DIV>&nbsp;</DIV><DIV>&#091;Aside: the existing sample is on our web site now. The revised one will be released with our forthcoming "DevForce Cookbook." Look for the Cookbook to arrive within a matter of weeks.&#093;</DIV><DIV>&nbsp;</DIV><DIV>The original point of the sample was to demonstrate how to wire up a ComboBox to DevForce entities AND bind that ComboBox to other DevForce entities. </DIV><DIV>&nbsp;</DIV><DIV>The previous version looked bloody awful; this one just looks bad.</DIV><DIV>&nbsp;</DIV><DIV>However, it's beautiful for the purpose of this forum post!&nbsp; You can plainly see employee, "Ima",&nbsp;in on the Blend art board. "Ima" does not exist in the Northwind tutorial database. She's a fake Employee, ginned up in a<strong> MainPageDesignViewModel</strong> that derives from the production <strong>MainPageViewModel</strong>. The view doesn't know; it's just binding to a ViewModel (VM).</DIV><DIV>&nbsp;</DIV><DIV>All of the fakery happens in the design VM's constructor, shown here:</DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: blue">    public</SPAN>&nbsp;MainPageDesignViewModel()&nbsp;{<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EntityManager&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">NorthwindManager</SPAN>(<SPAN style="COLOR: blue">false</SPAN>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EntityManager.DefaultQueryStrategy&nbsp;=&nbsp;<SPAN style="COLOR: #2b91af">QueryStrategy</SPAN>.CacheOnly;</PRE><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;designEmp&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Employee</SPAN>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EmployeeID&nbsp;=&nbsp;1,&nbsp;FirstName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Ima"</SPAN>,&nbsp;LastName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Blast"</SPAN>,&nbsp;ReportsToEmployeeID&nbsp;=&nbsp;2,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">var</SPAN>&nbsp;designManagerEmp&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Employee</SPAN>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EmployeeID&nbsp;=&nbsp;2,&nbsp;FirstName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Slim"</SPAN>,&nbsp;LastName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"Ornun"</SPAN>,&nbsp;ReportsToEmployeeID&nbsp;=&nbsp;<SPAN style="COLOR: blue">null</SPAN>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</PRE><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EntityManager.AttachEntity(designEmp);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EntityManager.AttachEntity(designManagerEmp);</PRE><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PotentialManagers&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">List</SPAN>&lt;<SPAN style="COLOR: #2b91af">Employee</SPAN>&gt;&nbsp;{&nbsp;designManagerEmp&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CurrentEmployee&nbsp;=&nbsp;designEmp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Messages.Add(<SPAN style="COLOR: #a31515">"We're&nbsp;in&nbsp;DesignTime&nbsp;now&nbsp;!!!"</SPAN>);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</PRE></DIV><DIV>The design version of the VM (a) creates&nbsp;two&nbsp;fake employess (Ima and her boss, Slim),&nbsp;(b) creates&nbsp;a disconnected, cache-only EntityManager (EM)&nbsp;- to ensure there is no attempt to talk to the database, and (c) adds the two employees to that EM. Because both fakes are in cache, DevForce can implement the navigation between Ima and&nbsp;Slim via the "Manager" property. I neglected to show this in the ComboBox but you can see it in the message which reads "Ima Blase whose manager is Slim Ornun".</DIV><DIV>&nbsp;</DIV><DIV>It is only a few short hops from here to doing the cache-to-file trick that Jason wants. In fact, I've done what Jason wants on a different project and we'll provide a similar, smaller example in one of the Cookbook recipes .... although perhaps not in the first Cookbook edition. Trust me, it works great.</DIV><DIV>&nbsp;</DIV><DIV>To be precise, it <EM>worked</EM> great for test runs of your application that you wanted to be fast and free of the need to talk to a database. It didn't work in Blend (although for different reasons than Jason cites).</DIV><DIV>&nbsp;</DIV><DIV>Until DF 2010 v. 6.0.5, it simply wasn't viable to use DF entities in Cider (Visual Studio visual designer) or Blend because we required that the <EM>Desktop</EM> (aka Web aka "Full DotNet") model carry <EM>the same assembly name as the Silverlight model</EM>. No problem for the CLR but most tools, including design tools, just choked.</DIV><DIV>&nbsp;</DIV><DIV>Using the same assembly name is&nbsp;no longer required. In fact, is heavily discouraged.</DIV><DIV>&nbsp;</DIV><DIV>Now this ComboBox sample dates from 6.0.2 (I think) ... certainly before we got rid of the assembly name restriction. It did not Blend.</DIV><DIV>&nbsp;</DIV><DIV>All I had to do was some assembly renaming plus clean and re-build. The view popped right up in Cider and Blend. </DIV><DIV>&nbsp;</DIV><DIV>There was no data visualization though. Just a bunch of weird boxes. The XAML looked ok ... obviously it ran ok ... but it made no sense rendered in Cider or Blend.</DIV><DIV>&nbsp;</DIV><DIV>A little dragging around was helpful but I still wanted to see sample data.</DIV><DIV>&nbsp;</DIV><DIV>So I refactored the ViewModel to facilitate a derived, design-time version of that ViewModel&nbsp;and, <EM>presto</EM>,&nbsp;that's how I was able to get the layout you see in the image above. </DIV><DIV>&nbsp;</DIV><DIV>&#091;<EM>While I was at it, I replaced the button click wiring with Blend Behaviors ... and deleted the entire custom code-behind</EM>&#093;</DIV><DIV>&nbsp;</DIV><DIV>You can do the same things to your application, or wait for the Cookbook if you want to see the details.</DIV><DIV>&nbsp;</DIV><DIV>As I mentioned, the cache-to-file variation is not far off. That will take some explanation, however, as there are a few places you can stumble on the way ... as Jason discovered.&nbsp;&nbsp; Please hang in there.</DIV>]]>
   </description>
   <pubDate>Fri, 20 Aug 2010 01:21:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8108#8108</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : Are you using SL? I found this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8098#8098</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 19-Aug-2010 at 9:20am<br /><br />Are you using SL? I found this problem with SL but I believe they were/are addressing it. It's supposed to work under WPF.]]>
   </description>
   <pubDate>Thu, 19 Aug 2010 09:20:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8098#8098</guid>
  </item> 
  <item>
   <title>Attempting to mock data at *design* time : I&amp;#039;ve just been experimenting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8095#8095</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2076<br /><strong>Posted:</strong> 18-Aug-2010 at 9:53pm<br /><br />I've just been experimenting to see if I can use saved CacheState data to provide mocking in Blend and VS2010, but have hit an error in the EntityManager constructor.<br>It fails in Blend when it tries to resolve IdeaBlade.EntityModel.DataSourceResolver.<br><br>Has anyone ever managed to get this to work? I've attached the data as a resource, and that is found fine within Blend, but is there any way to fool or force the internal resolver so we can use a 'snapshot' of our live data for Blend development?<br><br>Using DF to avoid creating dozens of mock repositories on a large project? Now that would be a coup!<br>]]>
   </description>
   <pubDate>Wed, 18 Aug 2010 21:53:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2076&amp;PID=8095#8095</guid>
  </item> 
 </channel>
</rss>