<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>About .NET and Other Amenities</title><link>http://weblogs.asp.net/aboschin/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Debug Build: 20510.895)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/aboutdotnet" type="application/rss+xml" /><item><title>Silverlight 2.0: published the Silverlight Library samples</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/M-3CdfIsj6U/silverlight-2-0-published-the-silverlight-library-samples.aspx</link><pubDate>Wed, 07 May 2008 08:53:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6164863</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=6164863</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/05/07/silverlight-2-0-published-the-silverlight-library-samples.aspx#comments</comments><description>&lt;p&gt;I've published the code samples about my silverlight library. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;CollectionViewSource - &lt;a href="http://blog.boschin.it/articles/silverlight-radialpanel.aspx" target="_blank" rel="tag"&gt;article&lt;/a&gt; / &lt;a href="http://silverlight.boschin.it/library/CollectionViewSource/Default.aspx" target="_blank" rel="tag"&gt;example&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;RadialPanel - &lt;a href="http://blog.boschin.it/articles/Improving-Silverlight-2.0-databinding-with-a-CollectionViewSource-control.aspx" target="_blank" rel="tag"&gt;article&lt;/a&gt; / &lt;a href="http://silverlight.boschin.it/library/RadialPanel/Default.aspx" target="_blank" rel="tag"&gt;example&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Here you can find the samples index: &lt;a href="http://silverlight.boschin.it/library"&gt;http://silverlight.boschin.it/library&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The samples require the &lt;a href="http://www.microsoft.com/silverlight/resources/install.aspx?v=2.0" target="_blank" rel="tag"&gt;Silverlight 2.0 BETA 1&lt;/a&gt;.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a30a3fd6-0cad-4b59-8342-205a3ccc06a9" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight%20Library" rel="tag"&gt;Silverlight Library&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Code%20Samples" rel="tag"&gt;Code Samples&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6164863" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/M-3CdfIsj6U" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/05/07/silverlight-2-0-published-the-silverlight-library-samples.aspx</feedburner:origLink></item><item><title>Article: How to create a custom RadialPanel for Silverlight 2.0</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/jNPGnlh7lvw/article-how-to-create-a-custom-radialpanel-for-silverlight-2-0.aspx</link><pubDate>Fri, 02 May 2008 19:56:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6151314</guid><dc:creator>codeblock</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=6151314</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/05/02/article-how-to-create-a-custom-radialpanel-for-silverlight-2-0.aspx#comments</comments><description>&lt;p&gt;Due to the success of my &lt;a href="http://blog.boschin.it/articles/Improving-Silverlight-2.0-databinding-with-a-CollectionViewSource-control.aspx" target="_blank" rel="tag"&gt;previous article&lt;/a&gt; I've decided to repeat the experience writing another text about a Silverlight 2.0 argument. &lt;/p&gt;  &lt;p&gt;This time I would like to explore the layout capabilities and I've created a RadialPanel control and included it into my &lt;a href="http://www.codeplex.com/silverlight" target="_blank" rel="tag"&gt;Silverlight Library&lt;/a&gt; (ver. &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=silverlight&amp;amp;ReleaseId=13004" target="_blank" rel="tag"&gt;1.0.3043.0&lt;/a&gt;) published on codeplex.&lt;/p&gt;  &lt;p&gt;This is the opportunity to write an article on how to implements a custom layout panel. During the article I speak about Layout but also about Attached Properties that are strongly connected to the layout argument. &lt;/p&gt;  &lt;p&gt;Your feedback on the article and on my english writing are welcome.&lt;/p&gt;  &lt;p&gt;Link: &lt;a title="http://blog.boschin.it/articles/silverlight-radialpanel.aspx" href="http://blog.boschin.it/articles/silverlight-radialpanel.aspx"&gt;http://blog.boschin.it/articles/silverlight-radialpanel.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:61fa5def-ff51-47e5-9ad6-e490fc622b9d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight%202.0" rel="tag"&gt;Silverlight 2.0&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Layout" rel="tag"&gt;Layout&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Custom%20panels" rel="tag"&gt;Custom panels&lt;/a&gt;,&lt;a href="http://technorati.com/tags/RadialPanel" rel="tag"&gt;RadialPanel&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6151314" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/jNPGnlh7lvw" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/aboschin/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/aboschin/archive/tags/Silverlight+Playground/default.aspx">Silverlight Playground</category><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/05/02/article-how-to-create-a-custom-radialpanel-for-silverlight-2-0.aspx</feedburner:origLink></item><item><title>Article: Improving Silverlight 2.0 databinding with a CollectionviewSource control</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/2ZI0luRXfEw/article-improving-silverlight-2-0-databinding-with-a-collectionviewsource-control.aspx</link><pubDate>Sat, 26 Apr 2008 09:16:15 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6131845</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=6131845</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/04/26/article-improving-silverlight-2-0-databinding-with-a-collectionviewsource-control.aspx#comments</comments><description>&lt;p&gt;I've published a new article on my main weblog explaining how to create a CollectionViewSource control in Silverlight 2.0. The article has been written in english to get in touch with a mor broader audience.&lt;/p&gt;  &lt;p&gt;CollectionViewSource is a component originally developed for Windows Presentation Foundation and present in the System.Data namespace from the first release. Is is very useful to filter, sort and group data before it has binded to an user interface control. It work as a filter interposed between Data and consuming control and may be customized in a very easy way. Silverlight 2.0 does not have a similar class so I've worked hard to create this control to support my work and I've decided to release it under the CCPL license on codeplex (&lt;a href="http://www.codeplex.com/silverlight"&gt;http://www.codeplex.com/silverlight&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;The full explanation of its internal working is available at this address:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blog.boschin.it/articles/Improving-Silverlight-2.0-databinding-with-a-CollectionViewSource-control.aspx" href="http://blog.boschin.it/articles/Improving-Silverlight-2.0-databinding-with-a-CollectionViewSource-control.aspx"&gt;http://blog.boschin.it/articles/Improving-Silverlight-2.0-databinding-with-a-CollectionViewSource-control.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Please leave a comment if you like this article. I hope it is written in a good english, but if you have some comments on this argument please feel free to contact me on my contact form: &lt;a href="http://blog.boschin.it/contact.aspx"&gt;http://blog.boschin.it/contact.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:40fccd33-6327-48e0-b908-eecc9f1810f4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CollectionViewSource" rel="tag"&gt;CollectionViewSource&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Controls" rel="tag"&gt;Controls&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6131845" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/2ZI0luRXfEw" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/aboschin/archive/tags/Silverlight+Playground/default.aspx">Silverlight Playground</category><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/04/26/article-improving-silverlight-2-0-databinding-with-a-collectionviewsource-control.aspx</feedburner:origLink></item><item><title>Silverlight 2.0: A Double Click Manager</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/4daPklmmNIE/silverlight-2-0-a-double-click-manager.aspx</link><pubDate>Mon, 17 Mar 2008 21:56:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5989458</guid><dc:creator>codeblock</dc:creator><slash:comments>7</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=5989458</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/03/17/silverlight-2-0-a-double-click-manager.aspx#comments</comments><description>&lt;p&gt;One of the missing things of Silverlight is the capability to handle mouse double click events. This problem apply not only to Silverlight 1.0 but also to Silverlight 2.0 Beta 1. Silverlight is rich about Mouse event handling but have two limitations. The first one is the missing right-mouse-button handling due to the presence of a contextual menu for configuration of the plugin. The second thing is the presence of mouse up and down left-button events but not of the click and double-click.&lt;/p&gt;  &lt;p&gt;So, I decided to create a small class to handle this problem in a simply way. The class I created behave as a translator that receive mouse-up events and transform them in click/double-click. The only way to discriminate from single to double click is taking care of a brief timeout (300 ms) after the first incoming mouse-up event. If this timeout expires without another incoming mouse-up event we have to raise a click event. Instead, if a second mouse-up arrive we need to raise a double-click event. &lt;/p&gt;  &lt;p&gt;Handling events in this way has a little bit problem. We need to receive an event and then wait for another event without blocking the caller and the user interface itself. With javascript I handled this problem using a setTimeout() that reset a flag and raise the correct event after the timeout. With Silverlight 2.0 we need to use a Thread because it is the only way to wait an event without blocking the main thread.&lt;/p&gt;  &lt;p&gt;My MouseClickManager class handle the problem in this way. In the next code block I show the main methods of the class:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; /// Handles the click.&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;sender&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;The sender.&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;e&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;The &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;see&lt;/span&gt; &lt;span style="color: #ff0000"&gt;cref&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;System.Windows.Input.MouseButtonEventArgs&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; instance containing the event data.&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; public void HandleClick(object sender, MouseButtonEventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     lock(this)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         if (this.Clicked)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;             this.Clicked = false;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;             OnDoubleClick(sender, e);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;         else&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;             this.Clicked = true;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;             ParameterizedThreadStart threadStart = new ParameterizedThreadStart(ResetThread);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;             Thread thread = new Thread(threadStart);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;             thread.Start(e);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt; /// Resets the clicked flag after timeout.&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;state&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;The state.&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt; private void ResetThread(object state)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;     Thread.Sleep(this.Timeout);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;     lock (this)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;         if (this.Clicked)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;             this.Clicked = false;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;             OnClick(this, (MouseButtonEventArgs)state);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In the HandleClick method we receive the incoming events. Probably the event handler of the MouseLeftButtonUp event simply call this method passing sender and arguments. In this method first of all we need to acquire a lock on a shared resource. This resource is the &amp;quot;clicked&amp;quot; flag that indicate if we are handling the first or second event. After acquiring the lock we have two choices. If the clicked flag is set to false we are handling the first click event so we need to set the flag and start a thread that will wait 300 milliseconds before reset the flag. So if the clicked flag has not been reset when we receive the second mouse-up then we are handling a double click event.&amp;#160; &lt;/p&gt;

&lt;p&gt;This may appear simply, but it has a little drawback. When we need to raise the single-click event, we are running in a separate thread so we may incur in a cross thread situation and we need to marshal the thread context to the main thread itself to avoid this condition. This is a common problem in windows forms environment and also in WPF. To handle the problem we have to use the Dispatcher object. In this code snippet I show a brief example:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; /// Called when click occure.&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;summary&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;sender&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;The sender.&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; /// &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;e&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;The &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;see&lt;/span&gt; &lt;span style="color: #ff0000"&gt;cref&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;System.Windows.Input.MouseButtonEventArgs&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; instance containing the event data.&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;param&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; private void OnClick(object sender, MouseButtonEventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     MouseButtonEventHandler handler = Click;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     if (handler != null)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         this.Control.Dispatcher.BeginInvoke(handler, sender, e);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;quot;Control&amp;quot; is a reference to the control that we have to notify the event. So we will user the Control.Dispatcher.BeginInvoke() method to marshal the event. To use my class MouseClickManager you have simply to crate an instance passing a reference to the control that will receive the click/double click events. Than in the MouseLeftButtonUp event you will call the HandleClick method. The event handler connected to Click and DoubleClick events will be called appropriately.&lt;/p&gt;

&lt;p&gt;The class has been designed to configure the the timeout lenght. Some experiments revealed that 200 ms is less, but 400 ms is too much because we will begin to feel the click event delay.&lt;/p&gt;

&lt;p&gt;Download: &lt;a title="http://blog.boschin.it/download/mouseclickmanager.zip" href="http://blog.boschin.it/download/mouseclickmanager.zip"&gt;http://blog.boschin.it/download/mouseclickmanager.zip&lt;/a&gt; (1 KB)&amp;#160; &lt;/p&gt;

&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:338d7149-2384-49f0-8448-e67dd4d86aff" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight%202.0" rel="tag"&gt;Silverlight 2.0&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Threading" rel="tag"&gt;Threading&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5989458" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/4daPklmmNIE" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/aboschin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/03/17/silverlight-2-0-a-double-click-manager.aspx</feedburner:origLink></item><item><title>Visual Studio 2008: Suspected bug in Javascript references</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/leB6NtqNStE/visual-studio-2008-suspected-bug-in-javascript-references.aspx</link><pubDate>Mon, 18 Feb 2008 15:44:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5814546</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=5814546</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/02/18/visual-studio-2008-suspected-bug-in-javascript-references.aspx#comments</comments><description>&lt;p&gt;I've just published an issue on Microsoft Product Feedback Center about a strange behavior I've found in the last two days. I'm working with Visual Studio 2008, developing an AJAX Enabled application that use massive javascript code. I take advantage of new Visual Studio 2008 intellisense for Javaxript that applies to files using &amp;lt;reference&amp;gt; tags but I saw that using an embedded resource javascript library cause Visual Studio 2008 to lock exclusively the resource assembly and fail during compilation with this error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Unable to copy file &amp;quot;obj\Debug\ClassLibrary.dll&amp;quot; to &amp;quot;bin\Debug\ClassLibrary.dll&amp;quot;. The process cannot access the file 'bin\Debug\ClassLibrary.dll' because it is being used by another process&lt;/strong&gt;.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I've include a reference to a test project I've prepared to reproduce the issue, so you may download and test the example and possibly convalidate yourself the issue in the &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328999" target="_blank" rel="tag"&gt;page of the feedback center&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Steps to reproduce without my test project is:&lt;/p&gt;  &lt;p&gt;1) create a solution containing a classlibrary and a webapplication   &lt;br /&gt;2) create a embeddedresource.js file in the ClassLibrary and set it to Embedded Resource    &lt;br /&gt;3) add the WebResourceAttribute     &lt;br /&gt;4) create a referencing.js file in the WebApplication    &lt;br /&gt;5) insert a reference to the embeddedresource.js file like this: /// &amp;lt;reference name=&amp;quot;ClassLibrary.embeddedjscript.js&amp;quot; assembly=&amp;quot;ClassLibrary&amp;quot; /&amp;gt;    &lt;br /&gt;6) save and close all files    &lt;br /&gt;7) open both javascript files    &lt;br /&gt;8) run the compilation with CTRL+SHIFT+B (rebuild all)    &lt;br /&gt;9) the error happen&lt;/p&gt;  &lt;p&gt;Please take a moment to check my sample and please vote it on the feedback center if you get the same behavior.&lt;/p&gt;  &lt;p&gt;Test Project: &lt;a title="http://blog.boschin.it/download/referencebugtest.zip" href="http://blog.boschin.it/download/referencebugtest.zip"&gt;http://blog.boschin.it/download/referencebugtest.zip&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Feedback page: &lt;/p&gt;  &lt;p&gt;&lt;a title="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328999" href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328999"&gt;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328999&lt;/a&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:574412ff-2e69-49d4-8052-8806a2c3f8dd" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Visual%20Studio%202008" rel="tag"&gt;Visual Studio 2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Javascript%20References" rel="tag"&gt;Javascript References&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Bug" rel="tag"&gt;Bug&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5814546" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/leB6NtqNStE" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/aboschin/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://weblogs.asp.net/aboschin/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/aboschin/archive/tags/Microsoft+AJAX+Library/default.aspx">Microsoft AJAX Library</category><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/02/18/visual-studio-2008-suspected-bug-in-javascript-references.aspx</feedburner:origLink></item><item><title>Best ITA Apps: My application on MSDN Italy</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/TCLK92YAaJo/best-ita-apps-my-application-on-msdn-italy.aspx</link><pubDate>Wed, 06 Feb 2008 08:31:50 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5720938</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=5720938</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2008/02/06/best-ita-apps-my-application-on-msdn-italy.aspx#comments</comments><description>&lt;p&gt;The application I wrote some months ago is now published in the BEST ITA Apps showcase through the MSDN Italy weblog. I put into this application all my knowledge about Silverlight 1.0 and ASP.NET AJAX. &lt;/p&gt;  &lt;p&gt;The application has been write to support a realtime monitoring system that works with GPS informations send by the vehicles on a central server. It show the position and the duty of public transportation vehicles, with tools to display races delay and current status.&lt;/p&gt;  &lt;p&gt;It has been build using a transparent Silverlight layer on a map, and receive pseudo-realtime data from an AJAX ScriptService. The data is updated every few seconds and the vehicles marker move on the map. The application take advantage of AjaxControlToolkit to give a better user experience where it is necessary to get input from the user, and use silverlight for the rendering of markers, and tracks.&lt;/p&gt;  &lt;p&gt;I hope this may be a good example on how to use Silverlight in a real application.&lt;/p&gt;  &lt;p&gt;Link: &lt;a title="http://blogs.msdn.com/italy/archive/2008/02/05/best-ita-apps-selsystemweb-e-silverlight.aspx" href="http://blogs.msdn.com/italy/archive/2008/02/05/best-ita-apps-selsystemweb-e-silverlight.aspx"&gt;http://blogs.msdn.com/italy/archive/2008/02/05/best-ita-apps-selsystemweb-e-silverlight.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:375f3e8e-832d-4bc4-91e5-8fc20db8c29a" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/AjaxControlToolkit" rel="tag"&gt;AjaxControlToolkit&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Best%20ITA%20Apps" rel="tag"&gt;Best ITA Apps&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5720938" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/TCLK92YAaJo" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2008/02/06/best-ita-apps-my-application-on-msdn-italy.aspx</feedburner:origLink></item><item><title>Merry Christmas 2007</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/qCqrWiCH3go/merry-christmas-2007.aspx</link><pubDate>Mon, 24 Dec 2007 12:02:32 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5495988</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=5495988</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2007/12/24/merry-christmas-2007.aspx#comments</comments><description>&lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 15px 0px 0px; border-right-width: 0px" height="156" alt="Buon Natale 2007" src="http://blog.boschin.it/images/blog_boschin_it/WindowsLiveWriter/BuonNatale2007_FC69/christmas_tree_3.png" width="150" align="left" border="0"&gt;It is many time I do not post in this weblog due to heavy workload... &lt;/p&gt; &lt;p&gt;Now one day before Christmas I would like to wish you a Merry Christmas. I hope you will have a beautiful time with your relatives, enjoying during the Christmas time meeting people you never meet, doing things you never do, watching your children joy in the Christmas morning, and eating around the table with your best friends.&lt;/p&gt; &lt;p&gt;I don't know if you all celebrate the Christmas but if it is not I hope you will have also a beautyful time.&lt;/p&gt; &lt;h2&gt;&lt;em&gt;Besh wishes and Merry Christmas!&lt;/em&gt;&lt;/h2&gt; &lt;p&gt;&lt;em&gt;(I promise I return to post on this pages as soon as possible)&lt;/em&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5495988" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/qCqrWiCH3go" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2007/12/24/merry-christmas-2007.aspx</feedburner:origLink></item><item><title>Back from TechED 2007</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/GHVzY8jbcXk/back-from-teched-2007.aspx</link><pubDate>Mon, 12 Nov 2007 14:07:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5096277</guid><dc:creator>codeblock</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=5096277</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2007/11/12/back-from-teched-2007.aspx#comments</comments><description>&lt;p&gt;I'm back, finally from the TechEd 2007 I attended last week in Barcelona. This was my first time on an international conference and I have to be honest saying that the first few days I'm very disoriented because of the new environment, and because of the english speaking that I'm not really trained for.&lt;/p&gt;  &lt;p&gt;So, during the conference this problems has become less important and I had a really wonderful staying, plenty of new informations, personal contacts and parties in the Barcelona nights. I've attended both my tecnology specific sessions and different technology sessions and I found that is is better to dedicate this days to deeply know arguments that during the normal working time it is non possible to study. The best sessione I attended at all was dedicated to Astoria Project (by Pablo Castro) and CardSpace (by vittorio Bertocci). Both this sessions are plenty of code-examples and gave me some useful information about the incoming ADO.NET Data Service and the claim-based autentication. The work the guys of this teams done is very wonderful. &lt;/p&gt;  &lt;p&gt;The Astoria project enable our projects to share data across the network in a way similar to navigate a website. So if you are developing a bike catalog (as the samples shown...) you may access data in this way:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://localhost/bikes.svc/Categories"&gt;http://localhost/bikes.svc/Categories&lt;/a&gt; - give you the entire categories listing&lt;/p&gt;  &lt;p&gt;&lt;a href="http://localhost/bikes.svc/Categories!5"&gt;http://localhost/bikes.svc/Categories!5&lt;/a&gt;&amp;#xA0; - give you the categories with 5 as primary key&lt;/p&gt;  &lt;p&gt;&lt;a href="http://localhost/bikes.svc/Categories!5/Products"&gt;http://localhost/bikes.svc/Categories!5/Products&lt;/a&gt; - give access to the products in the category wth 5 as primary key&lt;/p&gt;  &lt;p&gt;This semantic enable to access resources easily also from javascript because Astoria outputs directly in JSON as well as XML. The Astoria services, created extending a WebDataService&amp;lt;T&amp;gt; abstract class are entirely based on Windows Commuication Foundation. &lt;/p&gt;  &lt;p&gt;On the other side CardSpace, delivered with the Framework 3.0, in the incoming framework 3.5 will become very usable and easy to implement. Into the ASP.NET toolbox where will be a new Login WebControl supporting the CardSpace autentication that enable ASP.NET application to be integrated with claim based autentication in a breeze. Vittorio, an Italian working in the USA ad evangelist developer, has explained this argument in a very clear way using many examples like MembershipAPI integration with CardSpace. I promise to deeply study the argument when I've some time free...&lt;/p&gt;  &lt;p&gt;There was many other sessions I attended; I was at the first session by Steve Swartz and Clemens Vasters and I'm very satisfied seeing them in a real cabaret-session that has introduced a very clear explanation about SOA from the Microsoft point of view. I've see also sessione on VSTS, Scrum, Virtual Earth and so on...&lt;/p&gt;  &lt;p&gt;At the end of the conference I have to thanks all the people I know and that will be patient speaking in quiet-mode to enable me to understand them speaking. Now i'm on the way to became and english-enabled person so the next year this will be a more simple appointment.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:79c03823-23dc-4b1b-b8a8-25ded10e9d61" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag:  		&lt;a href="http://technorati.com/tags/Barcellona/" rel="tag"&gt;Barcellona&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/TechED/" rel="tag"&gt;TechED&lt;/a&gt; 		&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5096277" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/GHVzY8jbcXk" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2007/11/12/back-from-teched-2007.aspx</feedburner:origLink></item><item><title>About freedom and about Italy</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/zjBMgae_ZMg/about-freedom-and-about-italy.aspx</link><pubDate>Fri, 19 Oct 2007 14:32:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4631921</guid><dc:creator>codeblock</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=4631921</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2007/10/19/about-freedom-and-about-italy.aspx#comments</comments><description>&lt;p&gt;It seems I will have to virtually leave my country. Some days ago our government has approved a new law that will rule the internet information. It is a new way to obtain money from the Italian people, because this law will add a new Internet Tax for the people that want to publish informations like weblogs. Addictionally it seems will be the the rule to register itself in a ROC (registry of communications) and probably acquire a Publishing Manager, responsible of the contents published in the blogs that wil have to be subscribed in a registry of journalists... like a newspaper...&lt;/p&gt;  &lt;p&gt;Yes, it's true. Our country is not a democracy... so probably i will have to leave my country if i would like to continue writing in my weblogs... :(&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cfc73237-6d7e-4919-b797-5036764b213f" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tag:  		&lt;a href="http://technorati.com/tags/Italian%20Politics/" rel="tag"&gt;Italian Politics&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Freedom/" rel="tag"&gt;Freedom&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Weblogs./" rel="tag"&gt;Weblogs.&lt;/a&gt; 		&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4631921" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/zjBMgae_ZMg" height="1" width="1"/&gt;</description><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2007/10/19/about-freedom-and-about-italy.aspx</feedburner:origLink></item><item><title>AJAX: How to control an &lt;asp:Timer&gt; on client-side</title><link>http://feedproxy.google.com/~r/aboutdotnet/~3/vvfB_doqHl0/ajax-how-to-control-an-lt-asp-timer-gt-on-client-side.aspx</link><pubDate>Fri, 05 Oct 2007 23:42:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4374205</guid><dc:creator>codeblock</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/aboschin/rsscomments.aspx?PostID=4374205</wfw:commentRss><comments>http://weblogs.asp.net/aboschin/archive/2007/10/06/ajax-how-to-control-an-lt-asp-timer-gt-on-client-side.aspx#comments</comments><description>&lt;p&gt;Often I ask myself why it does not exist a way to control the status of a timer control on client-side. The Timer is a client-side control, incapsulated as IScriptControl into a server-control, but its use is focused in raise asyncronous postbacks without the intervention of the&amp;nbsp;user.&amp;nbsp;But it is simply uncontrollable. After you set its interval and enable it on server side it is impossible to stop it on the client without raise a postback.&lt;/p&gt; &lt;p&gt;This is a bad thing in my opinion. There was a bunch of cases when you may have the need to stop/start the timer responding to a client event. So&amp;nbsp;I decided to analyze the inner working of the control to find a way to solve this issue. And here is the result of my work.&lt;/p&gt; &lt;p&gt;Suppose to have a Timer oin a page, side by side with a Checkbox thats need to start/stop the temporized postback. The first step is to find a reference to the client component representing the Timer.&lt;/p&gt; &lt;p&gt; &lt;div class="wlWriterSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:eb4ec5cd-d9ed-4418-83db-1b27bbf08a6a" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre  style="width:100%;;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; timer &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; $find(&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;%= timer.ClientID %&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;the $find() function simply enumerate all the components registered into the page and returns the instance to the caller. Now here is how to write an event handler for the click event of the checkbox to enable/disable the timer:&lt;/p&gt;
&lt;p&gt;
&lt;div class="wlWriterSmartContent" id="F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:b34ef050-dc17-43da-b91b-3c7074c1666d" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre  style="width:100%;;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000;"&gt;var chkEnabled &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; $&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;get&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;chkEnabled&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);

chkEnabled.onclick &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; function() 
{
    var timer &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; $find(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;lt;%= timer.ClientID %&amp;gt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;); 

    timer.set_enabled(chkEnabled.&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;checked&lt;/span&gt;&lt;span style="color: #000000;"&gt;);

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (timer.get_enabled()) 
        timer._startTimer(); 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
        timer._stopTimer(); 
}
&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You may think to have simply to set/reset the enabled property, but watching at the timer client code you may see that this property is not directly linked with the start/stop of the timer. It is only a property to acquire the value of the server control property, like always happen with the IScriptControls. So you have to manually call the _startTimer() and _stopTimer() private methods for this action to have an effect.&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:131dd23a-0c1b-44b1-aa2d-29525476a9d7" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;, &lt;a href="http://technorati.com/tags/AJAX" rel="tag"&gt;AJAX&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Timer" rel="tag"&gt;Timer&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Javascript" rel="tag"&gt;Javascript&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4374205" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/aboutdotnet/~4/vvfB_doqHl0" height="1" width="1"/&gt;</description><category domain="http://weblogs.asp.net/aboschin/archive/tags/asp.net/default.aspx">asp.net</category><category domain="http://weblogs.asp.net/aboschin/archive/tags/Microsoft+AJAX+Library/default.aspx">Microsoft AJAX Library</category><category domain="http://weblogs.asp.net/aboschin/archive/tags/AJAX/default.aspx">AJAX</category><feedburner:origLink>http://weblogs.asp.net/aboschin/archive/2007/10/06/ajax-how-to-control-an-lt-asp-timer-gt-on-client-side.aspx</feedburner:origLink></item></channel></rss>
