<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0"><channel><title>Derik Whittaker</title><link>http://devlicio.us/blogs/derik_whittaker/default.aspx</link><description>Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool
&lt;br /&gt;&lt;br /&gt;
&lt;div class="altnetgeekcode"&gt;&lt;a href="http://www.hanselman.com/altnetgeekcode/default.aspx?q=IOC(SM):MOC(RM):TDD(NU):SCC(Svn):ORM(L2S):XPP(-):XPP(+):DDD(T+)"&gt;IOC(SM):MOC(RM):TDD(NU):SCC(Svn):ORM(L2S):XPP(-):XPP(+):DDD(T+)&lt;/a&gt;&lt;/div&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DerikWhittakersBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="derikwhittakersblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Best Error Dialog ever w/ Visual Studio</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/28/best-error-dialog-ever-w-visual-studio.aspx</link><pubDate>Wed, 28 Jul 2010 12:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61269</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=61269</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=61269</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/28/best-error-dialog-ever-w-visual-studio.aspx#comments</comments><description>&lt;p&gt;Today I received the following error and thought it summed up my day perfectly.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_66D210AA.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_6665DDB5.png" border="0" height="183" width="484" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now the real question is what was I doing to receive this error&amp;hellip;&amp;hellip; I was trying to copy a single line (w/ 50 characters of text) to the clipboard&amp;hellip;DOH&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61269" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Humor/default.aspx">Humor</category></item><item><title>How to detect the theme being used in WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/27/how-to-detect-the-theme-being-used-in-wp7.aspx</link><pubDate>Tue, 27 Jul 2010 10:07:19 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61252</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=61252</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=61252</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/27/how-to-detect-the-theme-being-used-in-wp7.aspx#comments</comments><description>&lt;p&gt;As the Windows Phone 7 have either a dark (black) or light (white) theme which can be applied it will become very important for you to know which theme the user enabled in order to determine your applications color schema, this is assuming you are using styles which are not built into the skinning on WP7.&lt;/p&gt;  &lt;p&gt;Sadly detecting the current theme is a bit hackish as it requires you to take a look at a current loaded resource to determine the theme.&amp;#160; I would have hoped that this would be part of the built in SDK as I see this as a common need for many applications.&lt;/p&gt;  &lt;p&gt;Here is how you determine which theme is being used.&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;Color themeColor = (Color)Application.Current.Resources[&amp;quot;PhoneForegroundColor&amp;quot;];
        
if (themeColor.ToString() == &amp;quot;#FFFFFFFF&amp;quot;)
{
    this.PageTitle.Text = &amp;quot;Dark &amp;quot;;       
}
else if (themeColor.ToString() == &amp;quot;#DE000000&amp;quot;)
{
    this.PageTitle.Text = &amp;quot;Light &amp;quot;;    
}&lt;/pre&gt;

&lt;p&gt;As you can see the code to determine the theme is easy, but not clean in my opinion.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61252" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category></item><item><title>Dynamically Changing Resources in a ListBox using Binding and Converters</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/24/dynamically-changing-resources-in-a-listbox-using-binding-and-converters.aspx</link><pubDate>Sat, 24 Jul 2010 18:51:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61200</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=61200</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=61200</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/24/dynamically-changing-resources-in-a-listbox-using-binding-and-converters.aspx#comments</comments><description>&lt;p&gt;While working on an application targeted towards WP7 I wanted to have the application change style resource which was attached to a border element based on a value (aka a status) in my view model.&amp;nbsp; After searching around for a bit I was not able to come up w/ a complete end to end solution, only bits and pieces.&amp;nbsp; In order to help the next poor newbie I thought I would post my solution (btw, there may be a MUCH better solution than this out there).&lt;/p&gt;
&lt;p&gt;In this sample I simply created a test application based off of the Item List Template which comes out of the box with a few minor changes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Setting up the XAML &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_78426233.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_75B93075.png" border="0" height="266" width="1028" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The important item to pay attention to above is the highlighted line.&amp;nbsp; This is the line which will change the border brush via the converter based on the value in the &amp;lsquo;Color&amp;rsquo; property in my view model.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Changes to the View model&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_035BC6B1.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_77C60971.png" border="0" height="133" width="324" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The code above is the property I added which will allow us to trigger the border brush to determine what style to use &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Creating the Converter&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_36B78A0D.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_1E646FF2.png" border="0" height="543" width="1028" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The above is a pretty standard converter which uses the IValueConverter interface.&amp;nbsp; The Part in here it pay attention to is how I am grabbing the brush resources out of the App.xaml file (there may be a better way to do this, but i could not find this).&amp;nbsp; What this code does is basically determines which loaded resource to return based on the value passed into the converter&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Registering the Converter&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_3EDB89D7.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2BBA5D2B.png" border="0" height="56" width="1028" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Once you create your converter class (see above) you do need to register it in your app.xaml class.&amp;nbsp; Do do this simply follow the logic above.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Creating the Brush Resources&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_69D377DC.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_40E862D3.png" border="0" height="158" width="1028" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The code above will create the various resources needed to allow us to change the color of our item in XAML&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Populating the &amp;lsquo;live data&amp;rsquo;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_6F1238C0.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_46FF89A1.png" border="0" height="406" width="644" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The default template for the Item List project has all the data hard wired in the MainViewModel class.&amp;nbsp; I simply added the above logic to populate the color properties.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After you put all the above together you get&amp;hellip;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_208D8089.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_405BE444.png" border="0" height="772" width="422" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Notice how the little colors next to each item change, this is our doing :) Now of course this is a simple example, but it does go to prove how you can accomplish this.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61200" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Updated Bits for WP7 – Beta Build</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/12/updated-bits-for-wp7-beta-build.aspx</link><pubDate>Mon, 12 Jul 2010 20:56:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61069</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=61069</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=61069</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/12/updated-bits-for-wp7-beta-build.aspx#comments</comments><description>&lt;p&gt;Today MS announced an updated release of the WP7 tools.&amp;nbsp; I can tell you from using intermediate builds this is getting better and better.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Check out the build here - &lt;a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Have fun with the new Bits.&lt;/p&gt;
&lt;p&gt;Oh, and great job WP7 Team.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61069" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category></item><item><title>'ServiceReferences.ClientConfig' in the .xap application package Error in WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/12/servicereferences-clientconfig-in-the-xap-application-package-error-in-wp7.aspx</link><pubDate>Mon, 12 Jul 2010 13:53:26 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:61067</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=61067</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=61067</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/07/12/servicereferences-clientconfig-in-the-xap-application-package-error-in-wp7.aspx#comments</comments><description>&lt;p&gt;If you are trying to create a WP7 (or any silverlight project for that matter) and you are trying to access a WCF web service you may receive the following error when you try to create an instance of the WCF service.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Cannot find &amp;#39;ServiceReferences.ClientConfig&amp;#39; in the .xap application package. This file is used to configure client proxies for web services, and allows the application to locate the services it needs. Either include this file in the application package, or modify your code to use a client proxy constructor that specifies the service address and binding explicitly. Please see inner exception for details.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In my project I saw this because my WCF service references were NOT in the UI project, they were in a common/domain project.&amp;#160; Because of this the ServiceReferences.ClientConfig file was not being put in to the .xap package.&amp;#160; To solve this you simply need add a reference of the ServiceREferences.ClientConfig file inside your UI project.&amp;#160; Recompile and the problem goes away.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=61067" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Error: Contract.Requires&lt;TException&gt; must use the rewriter</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/30/error-contract-requires-lt-texception-gt-must-use-the-rewriter.aspx</link><pubDate>Wed, 30 Jun 2010 11:36:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60813</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=60813</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=60813</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/30/error-contract-requires-lt-texception-gt-must-use-the-rewriter.aspx#comments</comments><description>&lt;p&gt;If you are new to use the &lt;a href="http://research.microsoft.com/en-us/projects/contracts/"&gt;Code Contracts Library&lt;/a&gt; from Microsoft one exception you may run into is this&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Description: Must use the rewriter when using Contract.Requires&amp;lt;TException&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_79D1A948.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_54941342.png" border="0" height="494" width="524" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;What this error is telling you is that you must turn on the runtime checking for the project which hosts the code.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4C7C2546.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4A5F267D.png" border="0" height="118" width="484" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;One thing to pay attention to is that you MUST turn this on not for the project which calls the code w/ contracts, but rather the project that actually has the contracts call in it.&lt;/p&gt;
&lt;p&gt;BTW, in order to get the Code Contracts pane in the project options you must down load the latest version of the CC library from MS Research.&lt;/p&gt;
&lt;p&gt;Hope this helps the next person w/ this error.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60813" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Code+Contracts/default.aspx">Code Contracts</category></item><item><title>Speaking on MEF at the L’viv .Net Users Group</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/30/speaking-on-mef-at-the-l-viv-net-users-group.aspx</link><pubDate>Wed, 30 Jun 2010 11:18:40 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60811</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=60811</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=60811</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/30/speaking-on-mef-at-the-l-viv-net-users-group.aspx#comments</comments><description>&lt;p&gt;I just confirmed that when I am over in L’viv Ukraine working with our team there (btw, they are a kick @ss team) I will be speaking at the L’viv .Net Users group.&amp;#160; The topic of the night will be &lt;a href="http://code.msdn.microsoft.com/mef"&gt;MEF&lt;/a&gt; (on &lt;a href="http://mef.codeplex.com/"&gt;codeplex&lt;/a&gt;).&amp;#160; &lt;/p&gt;  &lt;p&gt;The Managed Extensibility Framework (MEF) is a new library in .NET that enables greater reuse of applications and components. Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed. If you are building extensible applications, extensible frameworks and application extensions, then MEF is for you. &lt;/p&gt;  &lt;p&gt;If you are in the area and are up for an English based session on MEF please stop by and say hello.&lt;/p&gt;  &lt;p&gt;For more information check out &lt;a href="http://dotnetug-lviv.blogspot.com/"&gt;http://dotnetug-lviv.blogspot.com/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60811" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Speaking/default.aspx">Speaking</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/MEF/default.aspx">MEF</category></item><item><title>My Silverlight Breakpoints are not being hit….How To Resolve this</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/25/my-silverlight-breakpoints-are-not-being-hit-how-to-resolve-this.aspx</link><pubDate>Fri, 25 Jun 2010 08:35:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60734</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=60734</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=60734</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/25/my-silverlight-breakpoints-are-not-being-hit-how-to-resolve-this.aspx#comments</comments><description>&lt;p&gt;Today I was working on a Silverlight 4 side application and for some odd reason my breakpoints were not being hit when I was debugging.&amp;nbsp; I took what I thought were the right steps to resolve the issue.&amp;nbsp; I &amp;hellip;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Killed the development web service&lt;/li&gt;
&lt;li&gt;Killed and restarted Firefox (3.6.4)&lt;/li&gt;
&lt;li&gt;Killed and restarted VS 2010&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sadly none of these options worked&amp;hellip;&amp;hellip;hum&lt;/p&gt;
&lt;p&gt;Next I hit up google for an answer.&amp;nbsp; My blogger in crime Chris Bennage has a similar &lt;a href="http://devlicio.us/blogs/christopher_bennage/archive/2010/01/17/silverlight-breakpoints-not-being-hit.aspx"&gt;post here&lt;/a&gt; that I read through, and tried.&amp;nbsp; However, this did not resolve my issue.&amp;nbsp; However when reading through the comments someone said something that sparked a thought.&amp;nbsp; That was to attach the debugger to the browser.&amp;nbsp; So I tried this, however that also did not work, but I was on the right track.&lt;/p&gt;
&lt;p&gt;In order for ME (and please note you may have a different end result than I did here) was to do the following.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start the project without debugging so it would open up in the browser&lt;/li&gt;
&lt;li&gt;Open up the Attach to Process dialog in VS     &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_2A9858CE.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2BCCCBE0.png" width="364" border="0" height="247" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Change the &amp;lsquo;Attach to&amp;rsquo; options and explicitly check Silverlight (this option may not be needed, but hey it worked)     &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_145217AF.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_408E9E93.png" width="364" border="0" height="196" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Scroll down in the Process dialog until you find something that has the type set to &amp;lsquo;Silverlight&amp;rsquo;, If it says &amp;#39;plugin-container.exe&amp;rsquo; then you are on the right one (this is what the silverlight plugin runs in when running Firefox).     &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_499B2A14.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_78BCEFDE.png" width="484" border="0" height="328" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Click Attach&lt;/li&gt;
&lt;li&gt;Debug away&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now again, this worked for me, this may NOT work for you.&amp;nbsp; Also, there may be a better way to do this, but this works until I can find the root cause.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60734" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>WCF &amp; Mex are correct, but why is my metadata not published????</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/17/wcf-amp-mex-are-correct-but-why-is-my-metadata-not-published.aspx</link><pubDate>Thu, 17 Jun 2010 12:15:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60625</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=60625</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=60625</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/17/wcf-amp-mex-are-correct-but-why-is-my-metadata-not-published.aspx#comments</comments><description>&lt;p&gt;Today I ran into a very interesting issue where my WCF service was not publishing my metadata&amp;hellip; but I had the Mex endpoint setup correctly.&amp;nbsp; When I tried to hit my hosted service in a browser I received the following message&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_676FB8E3.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_11DBEA01.png" border="0" height="539" width="604" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I double checked that my config was indeed correct it was&amp;hellip;. I was at a loss for a reason for this.&amp;nbsp; Then I started to retrace my config changes steps (because this was working only a few minutes prior) and I remembered that I had removed what I thought was an empty config section which did not appear to be needed.&lt;/p&gt;
&lt;p&gt;If you look at the config section below I assumed that since there was not a name on the behavior it was not being used so it was not needed.&amp;nbsp; But I guess I was wrong.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_2A6B8751.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_49AE2E24.png" border="0" height="78" width="484" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once I added this back I was able to get my metadata back and test via the browser or the WcfTestClient&lt;/p&gt;
&lt;p&gt;I both love WCF and hate WCF at the exact same time&amp;hellip;. :)&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60625" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category></item><item><title>WP7 ApplicationBarIconButton IsEnabled does not work in CTP</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/10/wp7-applicationbariconbutton-isenabled-does-not-work-in-ctp.aspx</link><pubDate>Thu, 10 Jun 2010 11:31:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60027</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=60027</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=60027</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/10/wp7-applicationbariconbutton-isenabled-does-not-work-in-ctp.aspx#comments</comments><description>&lt;p&gt;Because I have just spent the past 20-30 minutes trying to figure out why my Application Bar button was not being disabled when I set the IsEnabled = false on an ApplicationBarIconButton only to find out that this is a bug in the CTP I thought I would share this just in case someone else was having this issue.&lt;/p&gt;
&lt;p&gt;If you are trying to disable your App bar icons by using the IsEnabled = false, it will NOT work in the current CTP (this may this is only valid for installs done prior to this date 06.09.2010).&lt;/p&gt;
&lt;p&gt;For more information you can read this thread &lt;a title="http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/7849375c-3092-404e-9d74-ac93ea3ec597" href="http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/7849375c-3092-404e-9d74-ac93ea3ec597"&gt;http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/7849375c-3092-404e-9d74-ac93ea3ec597&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this saves others from pain and suffering.&lt;/p&gt;
&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60027" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category></item><item><title>PSA: Help my binding is not updating my View Model…. Check your Mode</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/06/psa-help-my-binding-is-not-updating-my-view-model-check-your-mode.aspx</link><pubDate>Sun, 06 Jun 2010 15:28:13 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:59845</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=59845</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=59845</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/06/psa-help-my-binding-is-not-updating-my-view-model-check-your-mode.aspx#comments</comments><description>&lt;p&gt;This is simply a PSA as I spent 10 minutes today scratching my head why my Property Change notification was not being fired when I edited some text boxes in a WP7 application.&amp;#160; &lt;/p&gt;  &lt;p&gt;I knew my binding was setup because the values in my ViewModel we showing up in my View, but when I would make a change to the text box the value was NOT being pushed back into my ViewModel.&lt;/p&gt;  &lt;p&gt;Once I determined that my binding was setup correctly (ok, kinda correctly) I bounced over to my XAML and realized I forgot to set the mode in my binding. Make sure your binding looks like below if you want your changes to be pushed into your ViewModel.&lt;/p&gt;  &lt;p&gt;{Binding State, Mode=TwoWay}&lt;/p&gt;  &lt;p&gt;If you forget to put the Mode=TwoWay you will NOT get updates&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=59845" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category></item><item><title>Creating Scrollable Edit Content in WP7</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/06/creating-scrollable-edit-content-in-wp7.aspx</link><pubDate>Sun, 06 Jun 2010 13:20:05 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:59842</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=59842</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=59842</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/06/creating-scrollable-edit-content-in-wp7.aspx#comments</comments><description>&lt;p&gt;When building out phone applications real estate is at a premium.&amp;#160; If you need to provide any type of edit content on the screen you either need to make the decision to only allow a few edit boxes to remove the need for scrolling or allow for scrolling.&lt;/p&gt;  &lt;p&gt;In this post We will take a look at how we can enable scrolling on your edit screens in WP7.&amp;#160; Imagine you have a screen like below which is trying to grab address information from a user.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_33E3B5A2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_5D2AD7D3.png" width="304" height="589" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see there are more text boxes on the page then can fit on one screen.&amp;#160; Because of this you need to provide the ability for the user to scroll through the content.&amp;#160;&amp;#160; The good news for you this is dead simple with XAML/Silverlight.&amp;#160; The key to enabling scrolling in Silverlight is the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.aspx"&gt;ScrollViewer&lt;/a&gt; control.&amp;#160; The ScrollViewer enables content to be displayed in a smaller area than its actual size. When the content of the ScrollViewer is not entirely visible, the ScrollViewer displays scrollbars that the user can use to move the content areas that is visible. The area that includes all of the content of the ScrollViewer is the extent. The visible area of the content is the viewport.&lt;/p&gt;  &lt;p&gt;To see how this would work with our code take a look below;&lt;/p&gt;  &lt;pre style="display:none;" class="c-sharp" name="code"&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/ScrollViewerCode_5F00_5EA1CA0E.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="ScrollViewerCode" border="0" alt="ScrollViewerCode" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/ScrollViewerCode_5F00_thumb_5F00_6EED1BFA.png" width="644" height="448" /&gt;&lt;/a&gt; &lt;/pre&gt;

&lt;p&gt;(Sorry for the screen shot of the code, I was having formatting issues w/ the XAML)&lt;/p&gt;

&lt;p&gt;If you look at the code above you will see that we first create an entry for the ScrollViewer control.&amp;#160; We then put our ‘scrollable’ content inside this control.&amp;#160; By putting your content in this control it will enable scrolling if the content exceeds the bounds of the UI.&lt;/p&gt;

&lt;p&gt;Hope this helps,&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=59842" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WP7/default.aspx">WP7</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category></item><item><title>Quick Lap Around MEF at the Raleigh VS 2010 Road Show</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/02/quick-lap-around-mef-at-the-raleigh-vs-2010-road-show.aspx</link><pubDate>Thu, 03 Jun 2010 00:02:53 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:59605</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=59605</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=59605</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/06/02/quick-lap-around-mef-at-the-raleigh-vs-2010-road-show.aspx#comments</comments><description>&lt;p&gt;Today at the Raleigh VS Southern Road Show which was put on by &lt;a href="http://www.structuretoobig.com/"&gt;Brian Hitney&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/glengordon/"&gt;Glenn Gordon&lt;/a&gt; I had a chance to do a 20 minute lightning talk on MEF.&amp;#160; Because I only had 20 minutes, my talk focused on explaining the ‘what and the why’ along with providing 2 (had 3 but only got through 2 of them) straight forward examples on how to use MEF.&lt;/p&gt;  &lt;p&gt;I thought it would be good to attach my slide deck (all 6 slides) along w/ my sample code &lt;a href="http://dimecasts.shared.s3.amazonaws.com/RaleighVS2010_Launch_MEF/LearningMEF_VS2010_LaunchEvent.zip"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks again Brain and Glenn, great show.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=59605" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Announcement/default.aspx">Announcement</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/MEF/default.aspx">MEF</category></item><item><title>Windows Phone 7 and Adding Project References</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/24/windows-phone-7-and-adding-project-references.aspx</link><pubDate>Mon, 24 May 2010 11:09:12 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:59177</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>55</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=59177</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=59177</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/24/windows-phone-7-and-adding-project-references.aspx#comments</comments><description>&lt;p&gt;As I continue to play with the new &lt;a href="http://developer.windowsphone.com/Default.aspx"&gt;Windows Phone 7&lt;/a&gt; bits I found myself a bit annoyed this morning.&amp;#160; I have created a shell of an application and I wanted to move some of the more business centric logic out of the main project and into a secondary one.&amp;#160; To do this I simply created a new Class Library project inside my same solution.&amp;#160; Once I had created this project I tried to add a project reference (not binary) from my new class library (which is targeting the .net 3.5 framework) to my WP7 project.&lt;/p&gt;  &lt;p&gt;However, as soon as I selected the project I received the following dialog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4EB2DDB2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4A3C5CEB.png" width="484" height="208" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;After reading this a few times I am still not 100% sure what the hell this is saying, but I think it is saying that only phone/silverlight projects can be added as project reference.&amp;#160; If this is the case this just SUCKS…&lt;/p&gt;  &lt;p&gt;Now, I was able to add reference to the project as a binary reference but this is not exactly what I had wanted to do.&lt;/p&gt;  &lt;p&gt;Does anyone know if this is just a CTP limitation or is this the way it will always be?&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=59177" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WindowsPhone/default.aspx">WindowsPhone</category></item><item><title>Getting Lazy with System.Lazy</title><link>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/19/getting-lazy-with-system-lazy.aspx</link><pubDate>Wed, 19 May 2010 10:51:07 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:58970</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>20</slash:comments><wfw:commentRss>http://devlicio.us/blogs/derik_whittaker/rsscomments.aspx?PostID=58970</wfw:commentRss><wfw:comment>http://devlicio.us/blogs/derik_whittaker/commentapi.aspx?PostID=58970</wfw:comment><comments>http://devlicio.us/blogs/derik_whittaker/archive/2010/05/19/getting-lazy-with-system-lazy.aspx#comments</comments><description>&lt;p&gt;One of the pretty cool new nuggets inside the .Net 4.0 framework is &lt;a href="http://msdn.microsoft.com/en-us/library/dd642331%28VS.100%29.aspx"&gt;System.Lazy and System.Lazy&amp;lt;T&amp;gt;&lt;/a&gt;.&amp;#160; What System.Lazy brings to the table is a way to create objects which may need to perform intensive operations and defer the execution of the operation until it is 100% absolutely needed.&lt;/p&gt;  &lt;p&gt;Lets take a look at how to use the System.Lazy type.&lt;/p&gt;  &lt;p&gt;To better convey how to use this type we should first create some context.&amp;#160; In our example (trivial i know) we will have an orders factory which creates orders.&amp;#160; Take a look at the code below.&lt;/p&gt;  &lt;pre style="display:none;" class="c-sharp" name="code"&gt;public class OrdersFactory
{
        
    public IList FetchOrders()
    {
        Console.WriteLine( &amp;quot;About to fetch orders&amp;quot; );

        return new List&amp;lt;Order&amp;gt;:
                    {
                        new Order {OrderId = 1, InvoiceNumber = 1, OrderAmount = 19.95D, ItemCount = 2},
                        new Order {OrderId = 2, InvoiceNumber = 2, OrderAmount = 29.95D, ItemCount = 3},
                        new Order {OrderId = 3, InvoiceNumber = 3, OrderAmount = 33.25D, ItemCount = 4},
                        new Order {OrderId = 4, InvoiceNumber = 4, OrderAmount = 19.95D, ItemCount = 1},
                        new Order {OrderId = 5, InvoiceNumber = 5, OrderAmount = 204.17D, ItemCount = 10},
                        new Order {OrderId = 6, InvoiceNumber = 6, OrderAmount = 32.54D, ItemCount = 4},
                    };
    }

    public Order FetchOrder()
    {
        Console.WriteLine( &amp;quot;About to fetch single order&amp;quot; );

        return new Order {OrderId = 1, InvoiceNumber = 1, OrderAmount = 19.95D, ItemCount = 2};
    }

}

public class Order
{
    public Int32 OrderId { get; set; }
    public Int32 InvoiceNumber { get; set; }
    public double OrderAmount { get; set; }
    public Int32 ItemCount { get; set; }
}&lt;/pre&gt;

&lt;p&gt;Pay attention to the Console.WriteLine in each factory method, these lines will provide us an indication of when the execution of these methods takes place.&lt;/p&gt;

&lt;p&gt;Now that we have context, lets look at the example code for System.Lazy&lt;/p&gt;

&lt;p&gt;In the code below we are going to call into the order factory and NOT use the values it returns right away. &lt;/p&gt;

&lt;pre style="display:none;" class="c-sharp" name="code"&gt;class Program
{
    static void Main( string[] args )
    {
        var ordersFactory = new OrdersFactory();

        Console.WriteLine(&amp;quot;Fetching order info --- non lazy&amp;quot;);
        var ordersAsNonLazy = ordersFactory.FetchOrders();
        var orderAsNonLazy = ordersFactory.FetchOrder();

        Console.ReadLine();
    }
}&lt;/pre&gt;

&lt;p&gt;If we run this console application you will receive the following information:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_39D53C78.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_206D393E.png" width="484" height="246" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You will notice that the second I call into the 2 methods they are executed, which is what is expected.&amp;#160; Now lets use the .Lazy namespace and see what changes&lt;/p&gt;

&lt;pre style="display:none;" class="c-sharp" name="code"&gt;class Program
{
    static void Main( string[] args )
    {
        var ordersFactory = new OrdersFactory();

        Console.WriteLine(&amp;quot;Fetching order info --- non lazy&amp;quot;);
        var ordersAsNonLazy = ordersFactory.FetchOrders();
        var orderAsNonLazy = ordersFactory.FetchOrder();

        Console.WriteLine( &amp;quot;-----&amp;quot; );
        Console.WriteLine( &amp;quot;-----&amp;quot; );

        Console.WriteLine( &amp;quot;Fetching order info --- lazy&amp;quot; );
        var ordersAsLazy = new Lazy&amp;lt;IList&amp;lt;Order&amp;gt;&amp;gt;( () =&amp;gt; { return ordersFactory.FetchOrders(); } );
        var orderAsLazy = new Lazy&amp;lt;Order&amp;gt;( () =&amp;gt; { return ordersFactory.FetchOrder(); } );

        Console.WriteLine( &amp;quot;Fetching order info --- lazy -- created lazy objects....&amp;quot; );
        Console.WriteLine( &amp;quot;Has Data been fetched for List? - {0}&amp;quot;, ordersAsLazy.IsValueCreated );
        Console.WriteLine( &amp;quot;Has Data been fetched for Order? - {0}&amp;quot;, orderAsLazy.IsValueCreated );

        Console.WriteLine( &amp;quot;Fetching order info --- lazy -- using lazy objects....&amp;quot; );
        var orders = ordersAsLazy.Value;
        var order = orderAsLazy.Value;

        Console.WriteLine( &amp;quot;Has Data been fetched for List? - {0}&amp;quot;, ordersAsLazy.IsValueCreated );
        Console.WriteLine( &amp;quot;Has Data been fetched for Order? - {0}&amp;quot;, orderAsLazy.IsValueCreated );

        Console.ReadLine();
    }
}&lt;/pre&gt;

&lt;p&gt;If we rerun this console application you will receive the following information:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_2B2A9093.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_62FCD4B6.png" width="484" height="246" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Here you will notice that i have created my points to the methods, but they have not been executed.&amp;#160; I know this by taking a look at the .IsValueCreated property on the Lazy type.&amp;#160; Since this has returned False I know my pointers have not been executed.&amp;#160; However, the second we call .Value you will see the messages appear which tell us the pointers have been executed.&amp;#160; &lt;/p&gt;

&lt;p&gt;Finally, if i recheck the .IsValueCreated property this time it returns True which tells me we have indeed executed our pointers.&lt;/p&gt;

&lt;p&gt;As you can see using Lazy is easy and can be a very powerful tool in your tool chest.&amp;#160; But like everything else, this feature of the framework is NOT meant for ever scenario, use it where it makes sense.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=58970" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category></item></channel></rss>
