<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tim Leung&#039;s Blog</title>
	<atom:link href="http://dotnettim.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnettim.wordpress.com</link>
	<description>a blog on .Net dev and SQL Server</description>
	<lastBuildDate>Thu, 16 Feb 2012 14:25:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dotnettim.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tim Leung&#039;s Blog</title>
		<link>http://dotnettim.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dotnettim.wordpress.com/osd.xml" title="Tim Leung&#039;s Blog" />
	<atom:link rel='hub' href='http://dotnettim.wordpress.com/?pushpress=hub'/>
		<item>
		<title>LightSwitch &#8211; MSDN Article with Garth Henderson</title>
		<link>http://dotnettim.wordpress.com/2011/08/15/lightswitch-msdn-article-with-garth-henderson/</link>
		<comments>http://dotnettim.wordpress.com/2011/08/15/lightswitch-msdn-article-with-garth-henderson/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 16:48:21 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=723</guid>
		<description><![CDATA[The MSDN flash article that I’ve been working on with Garth was published last week. In terms of LightSwitch, Garth is one of most talented individuals that I know. For me, it&#8217;s been pleasure finding out and seeing the projects &#8230; <a href="http://dotnettim.wordpress.com/2011/08/15/lightswitch-msdn-article-with-garth-henderson/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=723&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The MSDN flash article that I’ve been working on with Garth was published last week.</p>
<p>In terms of LightSwitch, Garth is one of most talented individuals that I know. For me, it&#8217;s been pleasure finding out and seeing the projects that he&#8217;s worked on. </p>
<p>You can find out more by visiting the following link.</p>
<p><a title="http://blogs.msdn.com/b/ukmsdn/archive/2011/08/08/lightswitch-in-the-real-world.aspx" href="http://blogs.msdn.com/b/ukmsdn/archive/2011/08/08/lightswitch-in-the-real-world.aspx">http://blogs.msdn.com/b/ukmsdn/archive/2011/08/08/lightswitch-in-the-real-world.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/723/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/723/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/723/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=723&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/08/15/lightswitch-msdn-article-with-garth-henderson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; Automatically Upper Case TextBox Text</title>
		<link>http://dotnettim.wordpress.com/2011/08/05/lightswitch-automatically-upper-case-textbox-text/</link>
		<comments>http://dotnettim.wordpress.com/2011/08/05/lightswitch-automatically-upper-case-textbox-text/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 16:43:32 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=721</guid>
		<description><![CDATA[Here&#8217;s a quick post in reference to question on how to automatically upper case the characters whilst typing into a TextBox. LightSwitch includes a changed event but the problem with using this is that it only fires after leaving the &#8230; <a href="http://dotnettim.wordpress.com/2011/08/05/lightswitch-automatically-upper-case-textbox-text/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=721&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick post in reference to question on how to automatically upper case the characters whilst typing into a TextBox. </p>
<p>LightSwitch includes a changed event but the problem with using this is that it only fires after leaving the TextBox. You therefore don’t see the characters being upper cased as you type into the control. </p>
<p>One possible workaround is to handle the KeyUp event of the TextBox control. In keeping with the standard practice of handling Silverlight control events, the ControlAvailable event is used to attach the KeyUp event of the Textbox. </p>
<p>Assuming that you have a TextBox named ‘Surname’, here is some sample code that automatically upper cases the characters as you type into the control. The ‘SelectionStart’ property is used to set the cursor location to the end of the TextBox, otherwise you end up with some strange behaviour as subsequent text will be inserted into the start of the TextBox. </p>
<p>&nbsp;</p>
<pre class="csharpcode">Private Sub MyScreen_Activated()
    AddHandler Me.FindControl(<span class="str">"Surname"</span>).ControlAvailable, AddressOf TextBoxAvailable
End Sub

Private Sub TextBoxAvailable(sender As Object, e As ControlAvailableEventArgs)
    AddHandler CType(e.Control, System.Windows.Controls.TextBox).KeyUp, AddressOf TextBoxKeyUp
End Sub

Private Sub TextBoxKeyUp(sender As Object, e As System.Windows.RoutedEventArgs)
    Dim strTextUpper As String = CType(sender, System.Windows.Controls.TextBox).Text.ToUpper
    CType(sender, System.Windows.Controls.TextBox).Text = strTextUpper
    CType(sender, System.Windows.Controls.TextBox).SelectionStart = strTextUpper.Length
End Sub
</pre>
<p>Here&#8217;s the C# version.</p>
<p>&nbsp;</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> CreateNew_Activated()
{
    <span class="kwrd">this</span>.FindControl(<span class="str">"Property1"</span>).ControlAvailable += TextBoxAvailable;
}

<span class="kwrd">private</span> <span class="kwrd">void</span> TextBoxAvailable(<span class="kwrd">object</span> sender, ControlAvailableEventArgs e)
{
    ((System.Windows.Controls.TextBox)e.Control).KeyUp += TextBoxKeyUp;
}

<span class="kwrd">private</span> <span class="kwrd">void</span> TextBoxKeyUp(<span class="kwrd">object</span> sender, System.Windows.RoutedEventArgs e)
{
    <span class="kwrd">string</span> strTextUpper = ((System.Windows.Controls.TextBox)sender).Text.ToUpper;
    ((System.Windows.Controls.TextBox)sender).Text = strTextUpper;
    ((System.Windows.Controls.TextBox)sender).SelectionStart = strTextUpper.Length;
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/721/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/721/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/721/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=721&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/08/05/lightswitch-automatically-upper-case-textbox-text/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; Extension Development Kit</title>
		<link>http://dotnettim.wordpress.com/2011/06/04/lightswitch-extension-development-kit/</link>
		<comments>http://dotnettim.wordpress.com/2011/06/04/lightswitch-extension-development-kit/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 21:57:22 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=713</guid>
		<description><![CDATA[Earlier this week, Yann Duran mentioned the Extensibility Toolkit which was featured in Beth Massi’s recent video. http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV354 For those who haven’t watched this, the following post contains some screenshots from the video illustrating how this works. (I would still &#8230; <a href="http://dotnettim.wordpress.com/2011/06/04/lightswitch-extension-development-kit/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=713&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Earlier this week, Yann Duran mentioned the Extensibility Toolkit which was featured in Beth Massi’s recent video.</p>
<p><a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV354">http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV354</a></p>
<p>For those who haven’t watched this, the following post contains some screenshots from the video illustrating how this works. (I would still recommend watching the video however. The toolkit section appears at 55min).</p>
<p>The toolkit goes a long way to simplifying the creation of extensions. The current method of creating extensions using the “Cookbook” is fairly time consuming. In particular, the errors that could be encountered when renaming everything from “BlankExtension” can be very painful.</p>
<p>&nbsp;</p>
<h3>Screenshots</h3>
<p>With the Extension Library installed, opening Visual Studio and selecting “New Project” shows the following Extension templates.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/06/image.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/06/image_thumb.png?w=644&#038;h=461" width="644" height="461"></a></p>
<p>&nbsp;</p>
<p>Creating a new project based upon the above template creates a solution with the following projects.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/06/image1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/06/image_thumb1.png?w=286&#038;h=399" width="286" height="399"></a></p>
<p>&nbsp;</p>
<p>The above projects correspond to the projects in a regular LightSwitch project (for example Client, Common, Server, etc) You will notice 2 additional project which are the “Vsix” and “Lspkg” projects. The output from the Vsix project will be used to install the completed extension into Visual Studio.</p>
<p>LSPKG stands for “LightSwitch Packaging Project”. Right clicking on this and choosing “New Item” brings up the following screen.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/06/image2.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/06/image_thumb2.png?w=644&#038;h=456" width="644" height="456"></a></p>
<p>From here, templates relating to the 6 LightSwitch Extensibility points are available.</p>
<ul>
<li>Business Types</li>
<li>Custom Controls</li>
<li>Data Source</li>
<li>Screen Template</li>
<li>Shell</li>
<li>Theme</li>
</ul>
<p>Selecting the “Theme” option will create a theme which includes all the display elements. You can simply modify the fonts and colours to suit your style.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/06/image3.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/06/image_thumb3.png?w=644&#038;h=452" width="644" height="452"></a></p>
<p>&nbsp;</p>
<p>Although this toolkit has not yet been released, it should hopefully simplify the creation of extensions to a very large degree.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/713/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=713&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/06/04/lightswitch-extension-development-kit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Community Contributor Award 2011</title>
		<link>http://dotnettim.wordpress.com/2011/05/31/microsoft-community-contributor-award-2011/</link>
		<comments>http://dotnettim.wordpress.com/2011/05/31/microsoft-community-contributor-award-2011/#comments</comments>
		<pubDate>Tue, 31 May 2011 17:58:33 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=698</guid>
		<description><![CDATA[Today, I received an email awarding me a Microsoft Community Award for 2011. &#160; In all honesty, I knew very little about this award until today and still don’t know who nominated me nor what was involved in me being &#8230; <a href="http://dotnettim.wordpress.com/2011/05/31/microsoft-community-contributor-award-2011/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=698&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today, I received an email awarding me a <a href="https://www.microsoftcommunitycontributor.com/overview.aspx">Microsoft Community Award</a> for 2011.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image11.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb11.png?w=482&#038;h=371" width="482" height="371"></a></p>
<p>&nbsp;</p>
<p>In all honesty, I knew very little about this award until today and still don’t know who nominated me nor what was involved in me being awarded this prize. </p>
<p>I’m very grateful to those who were influential in this process. In particular, I’d like to thank all my friends at Microsoft UK and I also want to give a special mention to everyone in the Microsoft LightSwitch team who are currently doing a spectacular job.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/698/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=698&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/05/31/microsoft-community-contributor-award-2011/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Behaviour Driven Design with Ian Cooper</title>
		<link>http://dotnettim.wordpress.com/2011/05/31/behaviour-driven-design-with-ian-cooper/</link>
		<comments>http://dotnettim.wordpress.com/2011/05/31/behaviour-driven-design-with-ian-cooper/#comments</comments>
		<pubDate>Tue, 31 May 2011 14:47:06 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[VBUG]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=694</guid>
		<description><![CDATA[During this months user group meeting in Reading, Ian Cooper presented a session on Behaviour Driven Design. Much was covered during the event but some of the main points whichI took away were: Reducing rework is one of the key &#8230; <a href="http://dotnettim.wordpress.com/2011/05/31/behaviour-driven-design-with-ian-cooper/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=694&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>During this months user group meeting in Reading, Ian Cooper presented a session on Behaviour Driven Design. </p>
<p>Much was covered during the event but some of the main points whichI took away were:</p>
<ul>
<li>Reducing rework is one of the key principles of BDD</li>
<li>This is achieved by fully testing and involving the customer during each iteration</li>
<li>Analysis of typical applications reveal that 45% of features are never used. 7% of features are regularly used. There is much inefficiency is software as a large percentage of features are never used. </li>
<li><a href="http://en.wikipedia.org/wiki/5_Whys">‘5 Whys&#8217;</a> &#8211; recursively asking why something is required 5 times can often reveal the real purpose of a requirement</li>
<li>The <a href="http://www.informit.com/articles/article.aspx?p=1384195&amp;seqNum=2">&#8216;Purpose Alignment Model&#8217;</a> can be used to work out features which add the most business value. This comprises of a chart with &#8216;Market Differentiation&#8217; on the y-axis and &#8216;Mission Criticality&#8217; on the x-axis. By using this to understand the purpose of a project, we stand a much greater chance of achieving the objectives.</li>
</ul>
<p>Various tools such as Fit, Cucumber and Nbehave, Nunit, Mspec were also discussed. </p>
<p>I found Ian’s presentation very useful and so did many in the audience judging by some of the questions. Thanks for presenting Ian!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/694/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/694/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/694/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=694&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/05/31/behaviour-driven-design-with-ian-cooper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; Installing on Windows XP requires SP3</title>
		<link>http://dotnettim.wordpress.com/2011/05/14/lightswitch-installing-on-windows-xp-requires-sp3/</link>
		<comments>http://dotnettim.wordpress.com/2011/05/14/lightswitch-installing-on-windows-xp-requires-sp3/#comments</comments>
		<pubDate>Sat, 14 May 2011 13:16:02 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=676</guid>
		<description><![CDATA[This might be relevant to those building Virtual PCs or those who are planning on testing using Windows XP. Contrary to the system requirements that are specified on the LightSwitch website, the minimum version of XP required is in fact &#8230; <a href="http://dotnettim.wordpress.com/2011/05/14/lightswitch-installing-on-windows-xp-requires-sp3/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=676&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This might be relevant to those building Virtual PCs or those who are planning on testing using Windows XP. Contrary to the system requirements that are specified on the LightSwitch website, the minimum version of XP required is in fact SP3, and not SP2. The following error is returned if you attempt to install LightSwitch on XP SP2.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image9.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb9.png?w=364&#038;h=355" alt="image" width="364" height="355" border="0" /></a>  <a href="http://dotnettim.files.wordpress.com/2011/05/image10.png"><img style="padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb10.png?w=254&#038;h=294" alt="image" width="254" height="294" border="0" /></a><br /><em>Illustration of what happens when installing under XP SP2.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/676/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=676&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/05/14/lightswitch-installing-on-windows-xp-requires-sp3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Clearing Browser History now clears Flash Cookies in Version 10.3</title>
		<link>http://dotnettim.wordpress.com/2011/05/14/clearing-browser-history-now-clears-flash-cookies-in-version-10-3/</link>
		<comments>http://dotnettim.wordpress.com/2011/05/14/clearing-browser-history-now-clears-flash-cookies-in-version-10-3/#comments</comments>
		<pubDate>Sat, 14 May 2011 13:15:38 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[Uncategorised]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=677</guid>
		<description><![CDATA[After attending a security presentation this week, one thing I learnt is that clearing your internet browser history will now clear Flash cookies if you have the latest version of Flash installed. This was also reported through the IE blog &#8230; <a href="http://dotnettim.wordpress.com/2011/05/14/clearing-browser-history-now-clears-flash-cookies-in-version-10-3/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=677&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After attending a security presentation this week, one thing I learnt is that clearing your internet browser history will now clear Flash cookies if you have the latest version of Flash installed. This was also reported through the IE blog last week.</p>
<p><a title="http://blogs.msdn.com/b/ie/archive/2011/05/03/deleting-flash-cookies-made-easier.aspx" href="http://blogs.msdn.com/b/ie/archive/2011/05/03/deleting-flash-cookies-made-easier.aspx">http://blogs.msdn.com/b/ie/archive/2011/05/03/deleting-flash-cookies-made-easier.aspx</a></p>
<p>In previous versions of Flash, the only way of clearing cookies was to use the Adobe ‘Settings Manager’ via the following web site.</p>
<p><a title="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html" href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html">http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html</a></p>
<p>The security risk this posed was that even after deleting your browser history, someone using your PC could partially trace your browsing history and the videos that you’ve viewed using Flash cookies or the ‘Settings Manager’ shown above. Websites were also using Flash cookies to restore ‘regular HTTP cookies’ which may have been intentionally deleted by the user.</p>
<p>This update appears to have been long overdue and is a very positive change in terms of improving browser privacy.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/677/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=677&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/05/14/clearing-browser-history-now-clears-flash-cookies-in-version-10-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; Limiting Item Selections using a ComboBox</title>
		<link>http://dotnettim.wordpress.com/2011/05/09/lightswitch-limiting-item-selections-using-a-combobox/</link>
		<comments>http://dotnettim.wordpress.com/2011/05/09/lightswitch-limiting-item-selections-using-a-combobox/#comments</comments>
		<pubDate>Mon, 09 May 2011 20:56:00 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=668</guid>
		<description><![CDATA[Overview of Article One of the annoyances about the LightSwitch AutoCompleteBox is that there isn’t an option to limit selections to only those items which are shown in the list. Non existent values can be typed in, causing validation errors &#8230; <a href="http://dotnettim.wordpress.com/2011/05/09/lightswitch-limiting-item-selections-using-a-combobox/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=668&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Overview of Article</h3>
<p>One of the annoyances about the LightSwitch AutoCompleteBox is that there isn’t an option to limit selections to only those items which are shown in the list. Non existent values can be typed in, causing validation errors to occur when a screen is saved.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb.png?w=502&#038;h=201" width="502" height="201"></a></p>
<p><em>Fig 1 – Illustration of AutoCompleteBox failing to limit selections.</p>
<p></em></p>
<p>Fortunately, the Silverlight ComboBox control can limit items to the list and the following article describes how we can use this control on a LightSwitch screen.</p>
<p>In the following example, we’ll create a customer entry screen and allow the user to select from a list of available Countries. </p>
<p>&nbsp;</p>
<h3>Data</h3>
<p>The example solution contains a Person table and a Country table. The table schemas and relationships are illustrated in the following images below.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb1.png?w=656&#038;h=164" width="656" height="164"></a><br /><em>Fig 2 – Illustration of Person table </em></p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image2.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb2.png?w=651&#038;h=159" width="651" height="159"></a><br /><em>Fig 3 – Illustration of Country table </em></p>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image3.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb3.png?w=323&#038;h=313" width="323" height="313"></a></p>
<p><em>Fig 4 – One to Many relationship between Country and Person</em>&nbsp; </p>
<p>&nbsp;</p>
<h3>Screens </h3>
<p>The following section describes the creation of the screens in the project..</p>
<ol>
<li>First of all, create an ‘Editable Grid Screen’ on the Country table to enable some Countries to be added.</li>
<li>Create a ‘New Data Screen’ on the Person table.</li>
<li>By default, an ‘AutoCompleteBox’ is created on the Country field. Change this to ‘Custom Control’ using the drop down list to the left of the control. After doing so, bring up the properties of the control and click on the ‘Change…’ link next to the ‘Custom Control’ field. In the dialog that appears, select the ‘ComboBox’ control from within the System.Windows.Controls namespace.
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image4.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb4.png?w=186&#038;h=275" width="186" height="275"></a>&nbsp; <a href="http://dotnettim.files.wordpress.com/2011/05/image5.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb5.png?w=328&#038;h=276" width="328" height="276"></a><br /><em>Fig 5 – Changing the AutoCompleteBox to a ComboBox </p>
<p></em></li>
<li><em></em>We now need to create a data source in order to populate our ComboBox with a list of available Countries. In order to do this, click on the ‘Add Data Item’ button, select the ‘Query’ radio button and select ‘Countries – Country (All)’. Retain the default name of ‘Countries’.
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image6.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;margin:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb6.png?w=244&#038;h=244" width="244" height="244"></a><br /><em>Fig 6 &#8211; Creating a data source for our ComboBox<br /></em>&nbsp;</li>
<li>We now need to write some code to bind our ComboBox to the person entity. Click on ‘Write Code’ button and select the ‘_Activated’ event. Now write the following code:
</li>
<pre class="csharpcode"><span class="kwrd">Private</span> <span class="kwrd">Sub</span> CreateNewPerson_Activated()
    <span class="kwrd">Dim</span> comboControl <span class="kwrd">As</span> IContentItemProxy = <span class="kwrd">Me</span>.FindControl(<span class="str">"Country"</span>)
    comboControl.SetBinding(System.Windows.Controls.ComboBox.ItemsSourceProperty, <span class="str">"Screen.Countries"</span>, Windows.Data.BindingMode.TwoWay)
    comboControl.SetBinding(System.Windows.Controls.ComboBox.SelectedItemProperty, <span class="str">"Screen.PersonProperty.Country"</span>, Windows.Data.BindingMode.TwoWay)
<span class="kwrd">End</span> <span class="kwrd">Sub</span>
</pre>
<p>Here’s the C# equivalent…</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> CreateNewPerson_Activated()
{
    IContentItemProxy comboControl = <span class="kwrd">this</span>.FindControl(<span class="str">"Country"</span>);
    comboControl.SetBinding(System.Windows.Controls.ComboBox.ItemsSourceProperty, <span class="str">"Screen.Countries"</span>, System.Windows.Data.BindingMode.TwoWay);
    comboControl.SetBinding(System.Windows.Controls.ComboBox.SelectedItemProperty, <span class="str">"Screen.PersonProperty.Country"</span>, System.Windows.Data.BindingMode.TwoWay);
}
</pre>
<li>Now run our application and open the ‘Create Person’ screen. The list of Countries is now limited to those shown in the list. <br /><a href="http://dotnettim.files.wordpress.com/2011/05/image7.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb7.png?w=228&#038;h=140" width="228" height="140"></a><br /><em>Fig 7 – Illustration of final screen showing the ComboBox which can not be typed into.</em>
</li>
</ol>
<h3>Conclusion&nbsp; </h3>
<p>This article demonstrates how we can limit drop down choices by using a Silverlight ComboBox. It also illustrates the data binding syntax which is used when binding custom controls. The image below illustrates the relationship between the designer and the call to the SetBinding method. This is particularly relevant when creating a ‘details screen’ as the default entity will be ‘Person’ rather than ‘PersonProperty’. </p>
<h3>&nbsp;&nbsp; </h3>
<p><a href="http://dotnettim.files.wordpress.com/2011/05/image8.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/05/image_thumb8.png?w=692&#038;h=358" width="692" height="358"></a></p>
<p><em>Fig 8 – Illustration of DataBinding Code</em></p>
<p>&nbsp;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:40db4b31-35fa-4e4d-9523-7727773d0f91" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/LightSwitch+ComboBox" rel="tag">LightSwitch ComboBox</a>,<a href="http://technorati.com/tags/Limit+to+List" rel="tag">Limit to List</a>,<a href="http://technorati.com/tags/Control+DataBinding" rel="tag">Control DataBinding</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/668/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/668/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=668&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/05/09/lightswitch-limiting-item-selections-using-a-combobox/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/05/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; Add non existent records using AutoCompleteBox</title>
		<link>http://dotnettim.wordpress.com/2011/04/20/lightswitch-add-non-existent-records-using-autocompletebox/</link>
		<comments>http://dotnettim.wordpress.com/2011/04/20/lightswitch-add-non-existent-records-using-autocompletebox/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 21:40:12 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=645</guid>
		<description><![CDATA[Overview of Article The LightSwitch AutoCompleteBox allows you select records using a dropdown list or to enter some text into the control. Typing into the AutoCompleteBox filters down the selectable records. If a non existent record entered, it’s likely that &#8230; <a href="http://dotnettim.wordpress.com/2011/04/20/lightswitch-add-non-existent-records-using-autocompletebox/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=645&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Overview of Article</h3>
<p>The LightSwitch AutoCompleteBox allows you select records using a dropdown list or to enter some text into the control. Typing into the AutoCompleteBox filters down the selectable records. </p>
<p>If a non existent record entered, it’s likely that a new record is required based upon the entered text.&nbsp; </p>
<p>The following example uses a set of Customer and Category tables. A Customer belongs to a Category and the following sample demonstrates a ‘New Data Screen’ for creating a new Customer. The screen contains an AutoCompleteBox which allows a category to be selected. If a non existent category is typed in, the user will be prompted to save the new category prior to saving the customer record.</p>
<h3>Data</h3>
<p>The following screenshots illustrate the schema of our tables. A ‘zero or one’ to many relationship has been set up between the Category and Customer tables.</p>
<p>&nbsp;</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image29.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb29.png?w=639&#038;h=262" width="639" height="262"></a></p>
<p><em>Fig 1 – Category table schema</em></p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image30.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb30.png?w=642&#038;h=284" width="642" height="284"></a></p>
<p><em>Fig 2 – Customer table schema</em></p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image31.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb31.png?w=258&#038;h=250" width="258" height="250"></a></p>
<p><em>Fig 3 – Relationship between the 2 tables</em></p>
<h3>Screens</h3>
<p>Here are the steps to create our ‘Customer’ screen.</p>
<ol>
<li>Create a new ‘Editable Grid Screen’ for entering in some Category details
<li>Create a ‘New Data Screen’ based upon the Customer table
<li>In order to programmatically access the AutoCompleteBox, we need to add a reference to System.Windows.Controls.Input in the client project. To do this, switch to ‘File Mode’ in solution explorer.<br /><a href="http://dotnettim.files.wordpress.com/2011/04/image_thumb241.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image_thumb[24]" border="0" alt="image_thumb[24]" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb24_thumb.png?w=184&#038;h=86" width="184" height="86"></a><br /><em>Fig 4 Switch to File View in Solution Explorer</p>
<p></em>
<li>Right click the&nbsp; ‘Client’ folder and click ‘Add Reference’. Select System.Windows.Controls.Input <br /><a href="http://dotnettim.files.wordpress.com/2011/04/image_thumb251.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image_thumb[25]" border="0" alt="image_thumb[25]" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb25_thumb.png?w=244&#038;h=207" width="244" height="207"></a><br /><em>Fig 4 Add a reference to System.Windows.Controls.Input</p>
<p></em>
<li>We need to write some code to handle the LostFocus event of the AutoCompleteBox. However, this can only be done when the AutoCompleteBox becomes available. We therefore need to write an event handler for the ‘ControlAvailable’ event and to add the handler for the LostFocus event there. Click on the ‘Write Code’ button and click and select the ‘CreateNewCustomer_Created’ event. Add the following code:</p>
<pre class="csharpcode"><span class="kwrd">Private</span> <span class="kwrd">Sub</span> CreateNewCustomer_Created()
    <span class="kwrd">AddHandler</span> <span class="kwrd">Me</span>.FindControl(<span class="str">"Category"</span>).ControlAvailable, <span class="kwrd">AddressOf</span> CategoryFieldAvailable
<span class="kwrd">End</span> <span class="kwrd">Sub</span>

<span class="kwrd">Private</span> <span class="kwrd">Sub</span> CategoryFieldAvailable(sender <span class="kwrd">As</span> <span class="kwrd">Object</span>, e <span class="kwrd">As</span> ControlAvailableEventArgs)
    <span class="kwrd">AddHandler</span> <span class="kwrd">CType</span>(e.Control, System.Windows.Controls.Control).LostFocus, <span class="kwrd">AddressOf</span> CategoryFieldChanged
<span class="kwrd">End</span> <span class="kwrd">Sub</span>

<span class="kwrd">Private</span> <span class="kwrd">Sub</span> CategoryFieldChanged(sender <span class="kwrd">As</span> <span class="kwrd">Object</span>, e <span class="kwrd">As</span> System.Windows.RoutedEventArgs)

    <span class="rem">'Add a reference to System.Windows.Controls.Input.dll in the Client project</span>
    <span class="kwrd">Dim</span> txtComboText <span class="kwrd">As</span> <span class="kwrd">String</span> = <span class="kwrd">CType</span>(sender, System.Windows.Controls.AutoCompleteBox).Text
    <span class="kwrd">Me</span>.Details.Dispatcher.BeginInvoke(
        <span class="kwrd">Sub</span>()
            <span class="kwrd">If</span> txtComboText &lt;&gt; <span class="str">""</span> <span class="kwrd">Then</span>
                <span class="kwrd">Dim</span> selectedCategory <span class="kwrd">As</span> Category = <span class="kwrd">Me</span>.DataWorkspace.ApplicationData.Categories.Where(<span class="kwrd">Function</span>(Category) Category.CategoryName = txtComboText).FirstOrDefault
                <span class="kwrd">If</span> selectedCategory <span class="kwrd">Is</span> <span class="kwrd">Nothing</span> <span class="kwrd">Then</span>
                    <span class="rem">'Category doesn't exists</span>
                    <span class="kwrd">If</span> <span class="kwrd">Me</span>.ShowMessageBox(<span class="str">"Do you want to add the category "</span> &amp; txtComboText &amp; <span class="str">"?"</span>, <span class="str">"Add Category"</span>, MessageBoxOption.YesNo) = Windows.MessageBoxResult.Yes <span class="kwrd">Then</span>
                        selectedCategory = <span class="kwrd">Me</span>.DataWorkspace.ApplicationData.Categories.AddNew()
                        selectedCategory.CategoryName = txtComboText
                        <span class="kwrd">Me</span>.CustomerProperty.Category = selectedCategory
                    <span class="kwrd">End</span> <span class="kwrd">If</span>
                <span class="kwrd">End</span> <span class="kwrd">If</span>
            <span class="kwrd">End</span> <span class="kwrd">If</span>
        <span class="kwrd">End</span> <span class="kwrd">Sub</span>)

<span class="kwrd">End</span> <span class="kwrd">Sub</span>
</pre>
<p>Here’s how the C# equivalent looks like:
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> CreateNewCustomer_Created()
{
    <span class="kwrd">this</span>.FindControl(<span class="str">"Category"</span>).ControlAvailable += CategoryFieldAvailable;
}

<span class="kwrd">private</span> <span class="kwrd">void</span> CategoryFieldAvailable(<span class="kwrd">object</span> sender, ControlAvailableEventArgs e)
{
    ((System.Windows.Controls.Control)e.Control).LostFocus += CategoryFieldChanged;
}

<span class="kwrd">private</span> <span class="kwrd">void</span> CategoryFieldChanged(<span class="kwrd">object</span> sender, System.Windows.RoutedEventArgs e)
{
    <span class="rem">//Add a reference to System.Windows.Controls.Input.dll in the Client project</span>
    <span class="kwrd">string</span> txtComboText = ((System.Windows.Controls.AutoCompleteBox)sender).Text;
    <span class="kwrd">this</span>.Details.Dispatcher.BeginInvoke(() =&gt;
    {
        <span class="kwrd">if</span> (!<span class="kwrd">string</span>.IsNullOrEmpty(txtComboText)) {
            Category selectedCategory = <span class="kwrd">this</span>.DataWorkspace.ApplicationData.Categories.Where(Category =&gt; Category.CategoryName == txtComboText).FirstOrDefault;
            <span class="kwrd">if</span> (selectedCategory == <span class="kwrd">null</span>) {
                <span class="rem">//Category doesn't exists</span>
                <span class="kwrd">if</span> (<span class="kwrd">this</span>.ShowMessageBox(<span class="str">"Do you want to add the category "</span> + txtComboText + <span class="str">"?"</span>, <span class="str">"Add Category"</span>, MessageBoxOption.YesNo) == System.Windows.MessageBoxResult.Yes) {
                    selectedCategory = <span class="kwrd">this</span>.DataWorkspace.ApplicationData.Categories.AddNew();
                    selectedCategory.CategoryName = txtComboText;
                    <span class="kwrd">this</span>.CustomerProperty.Category = selectedCategory;
                }
            }
        }
    });

}
</pre>
<p>In the above code, we obtain the text that has been entered using the &#8216;Text&#8217; property of the AutoCompleteBox. If the text is not empty, we attempt to look up the Category in the Category table. If the Category isn&#8217;t found, we use &#8216;ShowMessageBox&#8217; to prompt the user to save the new Category. After the new Category is saved, we set the Category property on the Customer entity equal to the Category which has just been created.</p>
<li>Now run the application. Here are some illustrations showing the application in action. We begin by having just a ‘High Risk’ Category in the database.
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image32.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb32.png?w=455&#038;h=145" width="455" height="145"></a></p>
<p>In the ‘Create New Customer’ form, we enter a Firstname, Surname and type ‘Low Risk’ into the Category AutoCompleteBox. When we leave the Category AutoCompleteBox, the following dialog appears.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image33.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb33.png?w=461&#038;h=238" width="461" height="238"></a></p>
<p>If we click ‘Yes’, the Customer record is saved into the database. If we now return to the Category screen, we see that the ‘Low Risk’ category has also been added into the database. </p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image34.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb34.png?w=463&#038;h=166" width="463" height="166"></a></p>
</li>
</ol>
<p>&nbsp;</p>
<h3>Conclusion</h3>
<p>This article illustrates how records can be added using an AutoCompleteBox. The sample solution could benefit from some refinement but highlights various principles required in order to put together a working screen.</p>
<p>The example solution can be downloaded from the following link.</p>
<p><a title="http://cid-7a042700ee409d7b.office.live.com/self.aspx/LightswitchFiles/CustomerCategory3.zip" href="http://cid-7a042700ee409d7b.office.live.com/self.aspx/LightswitchFiles/CustomerCategory3.zip">http://cid-7a042700ee409d7b.office.live.com/self.aspx/LightswitchFiles/CustomerCategory3.zip</a></p>
<p>&nbsp;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:18381be4-fd2f-456b-86cf-a15b8175d51e" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/LightSwitch" rel="tag">LightSwitch</a>,<a href="http://technorati.com/tags/AutoCompleteBox+add+new+records" rel="tag">AutoCompleteBox add new records</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/645/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=645&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/04/20/lightswitch-add-non-existent-records-using-autocompletebox/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb29.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb30.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb31.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb24_thumb.png" medium="image">
			<media:title type="html">image_thumb[24]</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb25_thumb.png" medium="image">
			<media:title type="html">image_thumb[25]</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb32.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb33.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb34.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>LightSwitch &#8211; In What Order do Screen Events Fire?</title>
		<link>http://dotnettim.wordpress.com/2011/04/18/lightswitch-in-what-order-do-screen-events-fire/</link>
		<comments>http://dotnettim.wordpress.com/2011/04/18/lightswitch-in-what-order-do-screen-events-fire/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 21:38:29 +0000</pubDate>
		<dc:creator>dotnettim</dc:creator>
				<category><![CDATA[LightSwitch]]></category>

		<guid isPermaLink="false">https://dotnettim.wordpress.com/?p=602</guid>
		<description><![CDATA[Overview of Article There are various screen events available in LightSwitch. At the moment, there isn’t very much documentation specifying the order in which these events fire. The following post documents my findings in relation to the ordering of events. &#8230; <a href="http://dotnettim.wordpress.com/2011/04/18/lightswitch-in-what-order-do-screen-events-fire/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=602&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Overview of Article</h3>
<p>There are various screen events available in LightSwitch. At the moment, there isn’t very much documentation specifying the order in which these events fire.</p>
<p>The following post documents my findings in relation to the ordering of events.</p>
<h3>Methodology</h3>
<p>Having created a details screen based on a ‘Customer’ entity, this is a typical screen which is created by default. The name of the screen is ‘CustomerDetail’ and the name of the Customer entity is ‘Customer’.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image20.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb20.png?w=644&#038;h=285" alt="image" width="644" height="285" border="0" /></a></p>
<p><em>Fig 1 Illustration of Details screen</em></p>
<p>The following screenshot shows the available events. There are 3 property/entity events and 7 screen events. ‘CustomerId’ is the name of the property that relates to the screen parameter.</p>
<p><a href="http://dotnettim.files.wordpress.com/2011/04/image21.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb21.png?w=417&#038;h=358" alt="image" width="417" height="358" border="0" /></a></p>
<p><em>Fig 2 Events that are available</em></p>
<p>In order to work out the order in which these events fire, I’ve written some code showing a message box on each event. Here are my findings:</p>
<h3>Order of events when opening a screen</h3>
<ol>
<li>New</li>
<li>CustomerId_Changed</li>
<li>CustomerDetail_InitializeDataWorkspace</li>
<li>CustomerDetail_Created</li>
<li>CustomerDetail_Activated</li>
<li>Customer_Validate</li>
<li>CustomerId_Validate</li>
<li>Customer_Loaded</li>
</ol>
<h3>Order of Events when changing a field and clicking ‘Save’</h3>
<ol>
<li>CustomerDetail_Saving</li>
<li>Customer_Validate</li>
<li>CustomerId_Validate</li>
<li>Finalize</li>
</ol>
<h3>Order of Events when closing a screen with no changes</h3>
<ol>
<li>CustomerDetail_Closing</li>
<li>Finalize</li>
</ol>
<h3>Order of Events when closing a screen with unsaved changes and choosing to discard</h3>
<ol>
<li>CustomerDetail_Closing<br />
<a href="http://dotnettim.files.wordpress.com/2011/04/image22.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb22.png?w=320&#038;h=96" alt="image" width="320" height="96" border="0" /></a><br />
<em>  Dialog now appears – we choose ‘Discard’</em></li>
<li>Finalize</li>
</ol>
<h3>Order of Events when closing a screen with unsaved changes and choosing to save</h3>
<ol>
<li>CustomerDetail_Closing<br />
<a href="http://dotnettim.files.wordpress.com/2011/04/image23.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:0;" title="image" src="http://dotnettim.files.wordpress.com/2011/04/image_thumb23.png?w=320&#038;h=96" alt="image" width="320" height="96" border="0" /></a><br />
<em>Dialog now appears – we choose ‘Save’</em></li>
<li>CustomerDetail_Saving</li>
<li>Customer_Validate</li>
<li>CustomerId_Validate</li>
<li>Finalize</li>
</ol>
<p>As a final note, the CustomerDetail_Activated will fire whenever you change focus to another screen and return to it. Hopefully, this post sheds a bit more light into the ordering of events.</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d966f0d5-3f66-408a-a390-6283faa11aa5" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/LightSwitch" rel="tag">LightSwitch</a>,<a href="http://technorati.com/tags/Order+of+events" rel="tag">Order of events</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnettim.wordpress.com/602/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnettim.wordpress.com/602/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnettim.wordpress.com/602/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnettim.wordpress.com&amp;blog=17718255&amp;post=602&amp;subd=dotnettim&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnettim.wordpress.com/2011/04/18/lightswitch-in-what-order-do-screen-events-fire/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/423afe13efabd09388f80efdf699fe7e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnettim</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotnettim.files.wordpress.com/2011/04/image_thumb23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
