<?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/"
	>

<channel>
	<title>Buy Cephalexin Without Prescription</title>
	<atom:link href="http://robburke.net/tag/commanding/feed/" rel="self" type="application/rss+xml" />
	<link>http://robburke.net</link>
	<description>Robert Burke&#039;s home on the web.</description>
	<lastBuildDate>Thu, 04 Aug 2011 04:12:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Buy Cephalexin Without Prescription</title>
		<link>http://robburke.net/2008/04/wpf-command-pattern-when-does-it-query-canexecute/</link>
		<comments>http://robburke.net/2008/04/wpf-command-pattern-when-does-it-query-canexecute/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 13:30:23 +0000</pubDate>
		<dc:creator>Rob Burke</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Command Pattern]]></category>
		<category><![CDATA[Commanding]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://robburke.net/?p=105</guid>
		<description><![CDATA[<a href="http://robburke.net/2008/04/wpf-command-pattern-when-does-it-query-canexecute/"><img align="right" hspace="5" width="100" height="100" src="http://robburke.net/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignright wp-post-image tfe" alt="" title="" /></a>I had been merrily using WPF's built-in support for the Command Pattern for ages (see Commanding Overview Buy Cephalexin Without Prescription, , MSDN Docs, and article on implementing the command pattern in WPF, Jeff Druyt)... when suddenly it occured to &#8230; <a href="http://robburke.net/2008/04/wpf-command-pattern-when-does-it-query-canexecute/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p> I had been merrily using WPF's built-in support for the Command Pattern for ages (see <a href="http://msdn2.microsoft.com/en-us/library/ms752308.aspx">Commanding Overview</a> <b>Buy Cephalexin Without Prescription</b>, , MSDN Docs, and <a href="http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wpf_commandpattern.mspx">article on implementing the command pattern in WPF</a>, Jeff Druyt)... when suddenly it occured to me that I had no idea <em>what </em>triggered WPF to determine whether or not a command can be executed, <b>buy Cephalexin online no prescription</b>.  <b>Buy Cephalexin from canada</b>, Let me explain by reduction to an absurd example:</p>
<p>Say I have a command that can only execute when<br />
<p style="padding-left: 30px;"><strong><span style="color: #2b91af;">DateTime</span>.Now.Second % 2 == 0</strong><strong>.</strong></p><br />
I construct this command by home-brewing a static RoutedCommand instance:<br />
<div style="background: white none repeat scroll 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><br />
<p style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Commands</span></p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: #2b91af;">RoutedCommand</span> MyCommand { <span style="color: blue;">get</span> { <span style="color: blue;">return</span> m_MyCommand; } }</p><br />
<p style="margin: 0px; padding-left: 30px;"></p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: blue;">private</span> <span style="color: blue;">static</span> <span style="color: #2b91af;">RoutedCommand</span> m_MyCommand = <span style="color: blue;">new</span> <span style="color: #2b91af;">RoutedCommand</span></p><br />
<p style="margin: 0px; padding-left: 30px;">(</p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: #a31515;"> "Execute My Command"</span>,</p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: blue;"> typeof</span>(<span style="color: #2b91af;">Commands</span>), <b>Cephalexin price, coupon</b>, <b>Cephalexin in uk</b>, </p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: blue;"> new</span> <span style="color: #2b91af;">InputGestureCollection</span>()</p><br />
<p style="margin: 0px; padding-left: 30px;">{</p><br />
<p style="margin: 0px; padding-left: 30px;"><span style="color: blue;"> new</span> <span style="color: #2b91af;">KeyGesture</span>(<span style="color: #2b91af;">Key</span>.C, <span style="color: #2b91af;">ModifierKeys</span>.Alt)</p><br />
<p style="margin: 0px; padding-left: 30px;">}</p><br />
<p style="margin: 0px; padding-left: 30px;">);</p><br />
<p style="margin: 0px;">}</p></p>
<p></div><br />
And then I add a Command Binding for that command to my Window, <b>Cephalexin from international pharmacy</b>, <b>Buying Cephalexin online over the counter</b>, and assign the command to a Button:</p>
<p>&lt;Window x:Class="TestCommands.Window1"...&gt;<br />
<strong>&lt;Window.CommandBindings&gt;<br />
&lt;CommandBinding<br />
Command="{x:Static local:Commands.MyCommand}"<br />
Executed="MyCommandExecuted"<br />
CanExecute="MyCommandCanExecute"<br />
/&gt;<br />
&lt;/Window.CommandBindings&gt;<br />
</strong>...<br />
&lt;Button Width="200" Height="200"<br />
<strong> Command="{x:Static local:Commands.MyCommand}"<br />
</strong> Content="{Binding Path=IsEnabled}"<br />
/&gt;<br />
.., <b>order Cephalexin no prescription</b>.  <b>Cephalexin paypal</b>, &lt;/Window&gt;</p>
<p>By nature of WPF's awesomeness and WPF Commanding in general, the above Button's IsEnabled property should automatically be set to true or false based on whether or not the command can or can't be executed, <b>purchase Cephalexin online</b>.</p>
<p>Speaking of which, let's set up my Command's absurd logic in the CodeBehind by implementing its Execute and CanExecute event handlers:</p>
<p><!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20         \cf3 private\cf0  \cf3 void\cf0  MyCommandCanExecute(\cf3 object\cf0  sender, \cf4 CanExecuteRoutedEventArgs\cf0  e)\par ?, <b>Buy Cephalexin Without Prescription</b>.  <b>Where can i order Cephalexin without prescription</b>, \{\par ?.            \cf4 DateTime\cf0  now = \cf4 DateTime\cf0 .Now;\par ?, <b>Cephalexin prices</b>.  <b>Cephalexin pills</b>, \cf3 if\cf0  (CanExecuteOutput != \cf3 null\cf0 )\par ?.            \{\par ?, <b>where can i find Cephalexin online</b>.  <b>Buy Cephalexin Without Prescription</b>, CanExecuteOutput.Text = \cf5 "MyCommand CanExecute determined at "\cf0  + now.ToLongTimeString() + \cf5 " (and "\cf0  + now.Millisecond + \cf5 "ms)"\cf0 ;\par ?.  <b>Order Cephalexin from United States pharmacy</b>, \}\par ?.            e.CanExecute = \cf4 DateTime\cf0 .Now.Second % 2 == 0;\par ?, <b>ordering Cephalexin online</b>.  <b>Cephalexin over the counter</b>, \}\par ??\par ?.        \cf3 private\cf0  \cf3 void\cf0  MyCommandExecuted(\cf3 object\cf0  sender, <b>buy Cephalexin without a prescription</b>, <b>Buy Cephalexin online without prescription</b>, \cf4 ExecutedRoutedEventArgs\cf0  e)\par ?.        \{\par ?, <b>Buy Cephalexin Without Prescription</b>.            TextOutput.Text = \cf5 "MyCommand executed at "\cf0  + \cf4 DateTime\cf0 .Now.ToLongTimeString();\par ?, <b>purchase Cephalexin online no prescription</b>.  <b>Buy Cephalexin online with no prescription</b>, \}\par ??} --><br />
<div style="background: white none repeat scroll 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><br />
<p style="margin: 0px;"><span style="color: blue;">private</span> <span style="color: blue;">void</span> MyCommandCanExecute(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">CanExecuteRoutedEventArgs</span> e)</p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px;"><span style="color: #2b91af;"> DateTime</span> now = <span style="color: #2b91af;">DateTime</span>.Now;</p><br />
<p style="margin: 0px;"><span style="color: blue;"> if</span> (CanExecuteOutput != <span style="color: blue;">null</span>)</p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px;">CanExecuteOutput.Text = <span style="color: #a31515;">"MyCommand CanExecute determined at "</span> +</p><br />
<p style="margin: 0px;">now.ToLongTimeString() + <span style="color: #a31515;">" (and "</span> + now.Millisecond + <span style="color: #a31515;">"ms)"</span>;</p><br />
<p style="margin: 0px;">}</p><br />
<p style="margin: 0px;">e.CanExecute = <span style="color: #2b91af;">DateTime</span>.Now.Second % 2 == 0;</p><br />
<p style="margin: 0px;">}</p><br />
<p style="margin: 0px;"></p><br />
<p style="margin: 0px;"></p><br />
<p style="margin: 0px;"><span style="color: blue;">private</span> <span style="color: blue;">void</span> MyCommandExecuted(<span style="color: blue;">object</span> sender, <b>buy cheap Cephalexin no rx</b>, <b>Over the counter Cephalexin</b>, <span style="color: #2b91af;">ExecutedRoutedEventArgs</span> e)</p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px;">TextOutput.Text = <span style="color: #a31515;">"MyCommand executed at "</span> + <span style="color: #2b91af;">DateTime</span>.Now.ToLongTimeString();</p><br />
<p style="margin: 0px;">}</p><br />
<p style="margin: 0px;"></p></p>
<p></div><br />
So, my example is absurd but I bet you see my point by now: WPF is meant to automatically set the <strong>IsEnabled</strong> Property on that button to true or false, <b>Cephalexin overseas</b>, <b>Cephalexin san diego</b>, based on the results of the CanExecute method.  But in this case, <b>fast shipping Cephalexin</b>, <b>Where to buy Cephalexin</b>, the results of CanExecute are a function only of time, and thus change repeatedly and independently of "obvious" application events, <b>online buying Cephalexin hcl</b>.  <b>Saturday delivery Cephalexin</b>, So...  <strong><em>how does the Commanding system know when to query CanExecute and consequently enable/disable the button once a second?</em></strong> <b>Buy Cephalexin Without Prescription</b>, In this case, without further intervention, it <em>doesn't</em>.  It seems that when events are raised on the Window (a mouse button click, <b>Cephalexin trusted pharmacy reviews</b>, <b>Free Cephalexin samples</b>, etc.), CanExecute is re-evaluated, <b>Cephalexin discount</b>.  <b>Rx free Cephalexin</b>, (I don't know the details and wish I did.)  But, without further programmatic or user intervention, <b>order Cephalexin from mexican pharmacy</b>, <b>Cephalexin in canada</b>, the button will <strong>not </strong>automatically change its IsEnabled state once a second.</p>
<p>This led me back to the MSDN docs, <b>where to buy Cephalexin</b>, <b>Cephalexin from international pharmacy</b>, where I discovered the aptly-named InvalidateRequerySuggested event.  To coerce - er, <b>order Cephalexin no prescription</b>, <b>Buy Cephalexin online cod</b>, suggest - that WPF should query CanExecute, I set up the following DispatcherTimer:</p>
<p><!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20             m_DispatcherTimer = \cf3 new\cf0  \cf4 DispatcherTimer\cf0 ()\par ?, <b>order Cephalexin online overnight delivery no prescription</b>.            \{\par ?, <b>Buy Cephalexin Without Prescription</b>.  <b>Cephalexin over the counter</b>, Interval = \cf4 TimeSpan\cf0 .FromSeconds(0.25),\par ?, <b>next day Cephalexin</b>.  <b>Buy Cephalexin online without a prescription</b>, IsEnabled = \cf3 true\par ??\cf0             \};\par ?.            m_DispatcherTimer.Tick += \cf3 delegate\par ??\cf0             \{\par ?, <b>Cephalexin in us</b>.  <b>Where can i buy cheapest Cephalexin online</b>, \cf4 CommandManager\cf0 .InvalidateRequerySuggested();\par ?.            \};\par ??} --><br />
<div style="background: white none repeat scroll 0%; font-family: Courier New; font-size: 10pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><br />
<p style="margin: 0px;">m_DispatcherTimer = <span style="color: blue;">new</span> <span style="color: #2b91af;">DispatcherTimer</span>()</p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px;">Interval = <span style="color: #2b91af;">TimeSpan</span> <b>Buy Cephalexin Without Prescription</b>, .FromSeconds(0.25),</p><br />
<p style="margin: 0px;">IsEnabled = <span style="color: blue;">true</span></p><br />
<p style="margin: 0px;">};</p><br />
<p style="margin: 0px;">m_DispatcherTimer.Tick += <span style="color: blue;">delegate</span></p><br />
<p style="margin: 0px;">{</p><br />
<p style="margin: 0px;"><span style="color: #2b91af;"> CommandManager</span>.InvalidateRequerySuggested();</p><br />
<p style="margin: 0px;">};</p></p>
<p></div><br />
Now, the IsEnabled property of the Button blinks on and off as the Command's ability to be executed changes with the passing seconds.</p>
<p>Only then did I discover there's an <a href="http://msdn2.microsoft.com/en-us/library/ms771552.aspx">MSDN Docs sample called "Disable Command Source Via Dispatcher Timer Sample"</a> which is remarkably similar, <b>Cephalexin discount</b>.  <b>Cephalexin in uk</b>, There you have it. Now go forth and command WPF's Commanding, <b>Cephalexin san diego</b>.  <b>Buy Cephalexin without a prescription</b>, I'm sure you can all execute on that request &lt;g&gt;</p>
<p>P.S. Code for this sample is <a href="http://robburke.net/links/TestWPFCommands.zip">here</a>, <b>Cephalexin gel, ointment, cream, pill, spray, continuous-release, extended-release</b>.  <b>Saturday delivery Cephalexin</b>, P.P.S. What are folks using for pasting XAML and C# code into their blogs, <b>where can i buy Cephalexin online</b>.  <b>Free Cephalexin samples</b>, This entry is looking a little rough...  Cephalexin in australia.  Cephalexin in canada.  Over the counter Cephalexin.  Cephalexin from canadian pharmacy.  Cephalexin overseas.  Cephalexin buy.  Cephalexin price, coupon.  Cephalexin for sale.  Cephalexin pills.  Cephalexin prescriptions.  Where to buy Cephalexin.  Cephalexin in usa.  Buy Cephalexin from canada.</p>
<p></p>
<p><b>Similar posts:</b> <a href='http://robburke.net/?p=59'>Buy Valium Without Prescription</a>. <a href='http://robburke.net/?p=1551'>Order Effexor from United States pharmacy</a>.<br />
<b>Trackbacks from:</b> <a href='http://designora.com/?p=3301'>Buy Cephalexin Without Prescription</a>. <a href='http://www.lindseypollak.com/?p=601'>Buy Cephalexin Without Prescription</a>. <a href='http://blog.4amexpat.com/?p=72'>Buy Cephalexin Without Prescription</a>. <a href='http://keithburtis.com/?p=237'>Buy Cephalexin Without Prescription</a>. <a href='http://www.boothlakelanding.com/?p=2398'>Buy Cephalexin Without Prescription</a>. <a href='http://vbprogressives.com/?p=598'>Buy Cephalexin Without Prescription</a>. <a href='http://www.psynixis.com/blog/?p=393'>Buy Cephalexin Without Prescription</a>. <a href='http://blog.mymunster.com/?p=2328'>Buy Cephalexin Without Prescription</a>. <a href='http://reimaginerural.com/?p=2658'>Buy Cephalexin Without Prescription</a>. <a href='http://www.tulsaoilers.com/?p=193'>Buy Cephalexin Without Prescription</a>. <a href='http://www.bluevibestudio.com/?p=222'>Buy Cephalexin Without Prescription</a>. <a href='http://www.pixelbox.net/?p=251'>Buy Cephalexin Without Prescription</a>. <a href='http://blog.collages.net/?p=96'>Buy Cephalexin Without Prescription</a>. <a href='http://www.brokensilence.us/?p=1770'>Buy Cephalexin Without Prescription</a>. <a href='http://www.marclironblog.com/?p=83'>Buy Cephalexin Without Prescription</a>. <a href='http://www.motogpblog.com/?p=105'>Buy Cephalexin Without Prescription</a>. <a href='http://www.thejunglemap.com/?p=34'>Buy Cephalexin Without Prescription</a>. <a href='http://jyesmith.com/?p=2255'>Buy Cephalexin Without Prescription</a>. <a href='http://kiwicommons.com/?p=3954'>Buy Cephalexin Without Prescription</a>. <a href='http://www.heleneboudreau.com/?p=165'>Buy Cephalexin Without Prescription</a>. <a href='http://jshermanstudio.com/?p=543'>Online buy Cephalexin without a prescription</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robburke.net/2008/04/wpf-command-pattern-when-does-it-query-canexecute/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

