<?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>Clint&#039;s Dev Blog</title>
	<atom:link href="http://johnsondev.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnsondev.wordpress.com</link>
	<description>Advanced WPF tidbits</description>
	<lastBuildDate>Wed, 16 Sep 2009 02:48:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='johnsondev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Clint&#039;s Dev Blog</title>
		<link>http://johnsondev.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://johnsondev.wordpress.com/osd.xml" title="Clint&#039;s Dev Blog" />
	<atom:link rel='hub' href='http://johnsondev.wordpress.com/?pushpress=hub'/>
		<item>
		<title>WPF Validation</title>
		<link>http://johnsondev.wordpress.com/2009/09/16/wpf-validation/</link>
		<comments>http://johnsondev.wordpress.com/2009/09/16/wpf-validation/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 02:48:03 +0000</pubDate>
		<dc:creator>johnsondev</dc:creator>
				<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://johnsondev.wordpress.com/?p=34</guid>
		<description><![CDATA[Validation in WPF can be performed in a variety of ways.  There are  3 ways in particular:   &#8211; Manual   &#8211; Old   &#8211; New Recall that WPF fits into the view paradigm of the MVC.  Therefore, do notget &#8220;validating WPF&#8221; confused with &#8220;validating my business logic rules.&#8221;  For the purposes of a good design, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=34&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Validation in WPF can be performed in a variety of ways.  There are  3 ways in particular:</p>
<p>  &#8211; Manual</p>
<p>  &#8211; Old</p>
<p>  &#8211; New</p>
<p>Recall that WPF fits into the view paradigm of the MVC.  Therefore, do <strong>not</strong>get &#8220;validating WPF&#8221; confused with &#8220;validating my business logic rules.&#8221;  For the purposes of a good design, yes, you should include validation in your domain layer as well.</p>
<p> </p>
<p><strong>Manual method</strong></p>
<p>With the manual method, we see ourselves performing value checking in the Property setter and raising an exception if there is a problem.  For example</p>
<pre>public string Name {   get{return _name;}  set {      if(value == null)         {             throw new ArgumentNullException();          }         _name = value; }</pre>
<p> </p>
<p>Don&#8217;t do the above.  Supposing that your WPF Textbox, or any other UserControl, was bound to the Name property, then you would never see the exception.  <strong>WPF binding ignores exceptions!</strong></p>
<p><strong> </strong></p>
<p><strong><strong>2.  Old Method</strong></strong></p>
<p>The old method takes us back to the early days of HTML forms and javascript.  The algorithm is thus:</p>
<ul>
<li>On Button click, manually (in terms of writing inline code) check the values of all the parameters you wish to parse.</li>
<li>If they are good.
<ul>
<li>Parse input data. Submit.</li>
</ul>
</li>
<li>Else
<ul>
<li>Generate a custom error message.</li>
<li>Display the custom error message.</li>
<li>Return.</li>
</ul>
</li>
</ul>
<p>Now anyone that has ever done any manual validation in ASP.NET will realize that the above is painful, when compared to using the validation utility classes (such as the <strong>RegularExpressionValidator</strong>).  This takes us to the 3rd method.</p>
<p> </p>
<p><strong> 3.0 New Method</strong></p>
<p>The new method allows us to (1)put the display logic of the validation error straight in the <strong>XAML</strong>(2) keep high cohesion by separating our validation into separate classes, and (3) allows us to reuse validation logic across multiple UserControls.</p>
<p>The new method is composed of creating your own <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.validationrule.aspx">ValidationRule</a>. From there you simply (1) mention the validation rule in your data binding, and (2) define a style for how to display the error.  This <a href="http://www.codeproject.com/KB/WPF/wpfvalidation.aspx">page </a>has a nice example on how to do this (near the bottom).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnsondev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnsondev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnsondev.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=34&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://johnsondev.wordpress.com/2009/09/16/wpf-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6322279b0a606e3ca92add6c8bb0b0a1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnsondev</media:title>
		</media:content>
	</item>
		<item>
		<title>Binding not firing.w</title>
		<link>http://johnsondev.wordpress.com/2009/07/14/binding-not-firing/</link>
		<comments>http://johnsondev.wordpress.com/2009/07/14/binding-not-firing/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 13:32:19 +0000</pubDate>
		<dc:creator>johnsondev</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnsondev.wordpress.com/?p=28</guid>
		<description><![CDATA[Bindings problems are a difficult to debug as they are done dynamically at runtime.  One must recompile the code and run it in order to check that the bindings are firing. Sometimes there will be a warning in the output window complaining about a broken binding and sometimes not. Diagnoses Binding just is not working.  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=28&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bindings problems are a difficult to debug as they are done dynamically at runtime.  One must recompile the code and run it in order to check that the bindings are firing.</p>
<p>Sometimes there will be a warning in the output window complaining about a broken binding and sometimes not.</p>
<p><strong>Diagnoses</strong></p>
<p>Binding just is not working.  Syntax looks correct but it simply will not hook together</p>
<ol>
<li>Check that in the .xaml file, that the binding is has an ElementName=_this in it.  You will also need to define _this in the UserControl heading.
<ol>
<li>Eg. &lt;UserControl …</li>
</ol>
</li>
</ol>
<p>*Namespace_imports*</p>
<p>x:Name=_this&gt;</p>
<p><strong>Binding is firing but nothing is happening</strong></p>
<ol>
<li> Check you are calling <strong>NotifyPropertyChanged</strong> properly, with the correct name inside of the arguments (e.g. that “<span style="color:#339966;">MyProperty</span>” is spelled correctly in</li>
</ol>
<p style="text-align:center;">PropertyChanged(this, new PropertyChangedEventArgs(“<span style="color:#339966;">MyProperty</span>”));</p>
<p><strong>Using a non-gui thread to update a user control (and thus fire a binding)</strong></p>
<ol>
<li>Read up on <em>BeginInvoke</em> (which is asynchronous) or <em>Invoke</em> (which is synchronous) if calling a GUI a method or property of a user control in the code behind.    Quite frankly, a non-gui thread is not allowed to do modify the above.  You may be catching the exception and never hearing about it.</li>
</ol>
<p><strong>Binding worked for awhile but stopped (e.g. click a radio button fired a binding, but no longer)</strong></p>
<ol>
<li>Check that the object you are binding to in the code behind is initialized, so that it is<em> not null</em>, prior to <em>InitializeComponent</em>() being run;  If this is not possible (for a variety of reasons this may not be possible), then consider using a Dependency Property.</li>
<li>Check that a style isn’t clobbering your binding.  WPF only likes to apply one style to a component (note that you can combine multiple styles by creating one that is based on another).  If you have a binding declared on a component and then there is another style, you may notice that once a binding fires in your style, that the binding declared outside of the style no longer fires.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnsondev.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnsondev.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnsondev.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=28&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://johnsondev.wordpress.com/2009/07/14/binding-not-firing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6322279b0a606e3ca92add6c8bb0b0a1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnsondev</media:title>
		</media:content>
	</item>
		<item>
		<title>InitializeComponent &#8211; What it does</title>
		<link>http://johnsondev.wordpress.com/2009/06/07/initializecomponent-what-it-does/</link>
		<comments>http://johnsondev.wordpress.com/2009/06/07/initializecomponent-what-it-does/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 21:57:06 +0000</pubDate>
		<dc:creator>johnsondev</dc:creator>
				<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://johnsondev.wordpress.com/?p=22</guid>
		<description><![CDATA[InitializeComponent() is usually called within the in the default constructor of a WIndow or UserControl. It essentially &#8220;loads and initializes&#8221; the user controls contained within the XAML. For example, if you have XAML: &#60;Button x:Name=&#8221;_myButton&#8221; /&#62; CodeBehind: // Comments. _myBUtton will be null until after InitializeComponent() is called. After you call InitializeComponent, you will be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=22&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="border-collapse:collapse;font-family:Arial;font-size:14px;line-height:18px;text-align:left;"> </span></p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;"><code style="font-size:14px;vertical-align:baseline;background-color:transparent;font-family:Consolas,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New';border-width:0;margin:0;padding:0;">InitializeComponent()</code><span> is </span>usually called within the in the default constructor of a WIndow or UserControl.</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">It essentially &#8220;loads and initializes&#8221; the user controls contained within the XAML.</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">For example, if you have</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;"><strong>XAML</strong>:</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;"><em>&lt;Button x:Name=&#8221;_myButton&#8221; /&gt;</em></p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;"><strong>CodeBehind</strong>:</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">// Comments.</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">_<em>myBUtton </em>will be null until after <em>InitializeComponent</em>() is called. After you call <em>InitializeComponent</em>, you will be free to cal things on the button, such as <em>_myBUtton.COntent=&#8221;Press me&#8221;</em> (however, do not call that prior to InitializeComponent() or things will crash.</p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;"><strong>Notes Regarding Binding and InitializeComponent:</strong></p>
<p style="font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;border-width:0;margin:0 0 1em;padding:0;">Using <strong>NotifyPropertyChanged </strong>to binding to objects in your code behind</p>
<ul>
<li> Ensure that <span style="text-decoration:underline;">all of your</span> objects in your code behind are initialized (e.g. not null) prior to calling InitializeComponent(), otherwise your bindings will fail and not work properly (even if you initialize the objects you are binding to after the call to InitializeComponent)</li>
</ul>
<p>Using <strong>DependencyProperties </strong>as objects to bind to in your code behind</p>
<ul>
<li>Code behind objects do not need to be initialized prior to InitializeComponent call.  You can initialize objects which you are binding to after the InitializeComponent call and the bindings will pick up and work properly (however, using DependencyProperties is more cumbersome)</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnsondev.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnsondev.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnsondev.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=22&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://johnsondev.wordpress.com/2009/06/07/initializecomponent-what-it-does/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6322279b0a606e3ca92add6c8bb0b0a1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnsondev</media:title>
		</media:content>
	</item>
		<item>
		<title>Gotcha: Binding with ComboBox</title>
		<link>http://johnsondev.wordpress.com/2009/05/26/gotcha-binding-with-combobox/</link>
		<comments>http://johnsondev.wordpress.com/2009/05/26/gotcha-binding-with-combobox/#comments</comments>
		<pubDate>Tue, 26 May 2009 21:00:32 +0000</pubDate>
		<dc:creator>johnsondev</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[Gotcha]]></category>

		<guid isPermaLink="false">http://johnsondev.wordpress.com/?p=6</guid>
		<description><![CDATA[Turns out we will have problems if we try to bind the IsChecked property of a ComboBox to an underlying Property in our CodeBehind or ViewModel: Example: Problem: Everything will work fine and dandy under the radio button is clicked  (or activated via the space bar) You see, clicking the radio button automatically causes it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=6&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Turns out we will have problems if we try to bind the <strong>IsChecked </strong>property of a ComboBox to an underlying Property in our CodeBehind or ViewModel:</p>
<p>Example:</p>
<p><img class="aligncenter size-full wp-image-10" title="radio_problem" src="http://johnsondev.files.wordpress.com/2009/05/radio_problem1.jpg?w=450&#038;h=65" alt="radio_problem" width="450" height="65" /></p>
<p><strong>Problem</strong>:</p>
<p>Everything will work fine and dandy under the radio button is clicked  (or activated via the <em>space bar</em>) You see, clicking the radio button automatically causes it to be checked, regardless of the value that <em>IsChecked </em>is bound to, so when this disparity happens, the checkbox will no longer care about what it is bound to.</p>
<p>Rules</p>
<ul>
<li>UnderylyingValue = true =&gt; RadioButton checked</li>
<li>UnderylyingValue = false =&gt; RadioButton unchecked</li>
<li>Radio button is clicked on =&gt; Binding value is ignored</li>
<li>Radio button has space bar pressed on it =&gt; Binding value is ignored</li>
</ul>
<p><strong>Maybe styles? Nope</strong></p>
<p>You could say &#8220;aha problem with the binding mechanisms&#8221; and move the binding into a <strong>style</strong>, which would use DataTriggers to listen to <em>UnderlyingValue</em> and then changed IsChecked appropriately; but alas, this will also fail, just like the above, once the radio button is clicked.</p>
<p><strong>Solution</strong>:</p>
<p>We want to prevent the binding from being broken upon UI input; specifically, prevent it from being broken from (1) mouse click and (2) space bar press,  while not moving the solution into the code behind as that is poor design.</p>
<p>To do this, we&#8217;ll leverage RoutedEvents.  We will</p>
<ol>
<li>Capture the Mouse click and space bar events before the radio button itself gets to see the event</li>
<li> Make necessary changes and mark event as handled<strong> </strong></li>
</ol>
<p>Capturing the <strong>mouse </strong>and <strong>space bar</strong> event before radio button&#8230;</p>
<p><img class="aligncenter size-full wp-image-11" title="capture_preview_click" src="http://johnsondev.files.wordpress.com/2009/05/capture_preview_click.jpg?w=450&#038;h=87" alt="capture_preview_click" width="450" height="87" /></p>
<p><strong>Make necessary changes and mark event as handled</strong></p>
<p><img class="aligncenter size-full wp-image-12" title="change_handlers" src="http://johnsondev.files.wordpress.com/2009/05/change_handlers.jpg?w=450&#038;h=188" alt="change_handlers" width="450" height="188" /></p>
<p>And we&#8217;re done.</p>
<p><strong>Clicking </strong>or<strong> space bar </strong>causes our event handlers to fire, which change the property which our radio button is bound to and then the event is eaten.  The radio button is updated to reflect the state of the property we just changed, and the binding isn&#8217;t broken since the radio button never changes it&#8217;s <em>IsChecked </em>state as a result of the <em>click </em>or <em>space bar </em>press <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/johnsondev.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/johnsondev.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/johnsondev.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=johnsondev.wordpress.com&amp;blog=7885292&amp;post=6&amp;subd=johnsondev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://johnsondev.wordpress.com/2009/05/26/gotcha-binding-with-combobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6322279b0a606e3ca92add6c8bb0b0a1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">johnsondev</media:title>
		</media:content>

		<media:content url="http://johnsondev.files.wordpress.com/2009/05/radio_problem1.jpg" medium="image">
			<media:title type="html">radio_problem</media:title>
		</media:content>

		<media:content url="http://johnsondev.files.wordpress.com/2009/05/capture_preview_click.jpg" medium="image">
			<media:title type="html">capture_preview_click</media:title>
		</media:content>

		<media:content url="http://johnsondev.files.wordpress.com/2009/05/change_handlers.jpg" medium="image">
			<media:title type="html">change_handlers</media:title>
		</media:content>
	</item>
	</channel>
</rss>
