<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" 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/"><channel><title>Silverlight Controls and Silverlight Toolkit</title><link>http://forums.silverlight.net/forums/35.aspx</link><description>Discussions around using and developing Silverlight controls and the Silverlight Toolkit</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>RC0 - 'strange' event behaviour on disabled controls</title><link>http://forums.silverlight.net/forums/thread/98165.aspx</link><pubDate>Fri, 26 Sep 2008 23:37:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:98165</guid><dc:creator>Guardian11</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/98165.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=98165</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Lets consider this piece of Xaml&lt;/p&gt;&lt;p&gt;&amp;lt;StackPanel MouseEnter=&amp;quot;StackPanel_MouseEnter&amp;quot; MouseLeave=&amp;quot;StackPanel_MouseLeave&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Button Content=&amp;quot;test buttn&amp;quot; MouseEnter=&amp;quot;Button_MouseEnter&amp;quot; MouseLeave=&amp;quot;Button_MouseLeave&amp;quot; MouseLeftButtonDown=&amp;quot;Button_MouseLeftButtonDown&amp;quot; MouseLeftButtonUp=&amp;quot;Button_MouseLeftButtonUp&amp;quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Button IsEnabled=&amp;quot;False&amp;quot; Content=&amp;quot;test buttn&amp;quot; MouseEnter=&amp;quot;Button_MouseEnter&amp;quot; MouseLeave=&amp;quot;Button_MouseLeave&amp;quot; MouseLeftButtonDown=&amp;quot;Button_MouseLeftButtonDown&amp;quot; MouseLeftButtonUp=&amp;quot;Button_MouseLeftButtonUp&amp;quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;Button Content=&amp;quot;test buttn&amp;quot; MouseEnter=&amp;quot;Button_MouseEnter&amp;quot; MouseLeave=&amp;quot;Button_MouseLeave&amp;quot; MouseLeftButtonDown=&amp;quot;Button_MouseLeftButtonDown&amp;quot; MouseLeftButtonUp=&amp;quot;Button_MouseLeftButtonUp&amp;quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/StackPanel&amp;gt;&lt;/p&gt;&lt;p&gt;Basically we have 3 buttons in a StackPanel, the second one is disabled, each event make simple logging of the corresponding function called to the output window of VS.&lt;/p&gt;&lt;p&gt;moving the mouse from top to bottom over all the 3 buttons the sequence we obtain in RC0 is this:&lt;/p&gt;&lt;p&gt;Button_MouseEnter&lt;br /&gt;StackPanel_MouseEnter &amp;lt;- we enter on the panel and the first button&lt;br /&gt;Button_MouseLeave&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;- we exit the first button, we are over the second button (disabled)&lt;br /&gt;StackPanel_MouseLeave &amp;lt;- ?!?!?!?!? Over the disabled button the stackpanel fires the mouseleave event ?!?!?!?&lt;br /&gt;Button_MouseEnter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;- we enter and then exit the last button&lt;br /&gt;StackPanel_MouseEnter&lt;br /&gt;Button_MouseLeave&lt;br /&gt;StackPanel_MouseLeave&lt;/p&gt;&lt;p&gt;&amp;nbsp;In SL2B2 the StackPanel didn&amp;#39;t fired the Leave event we were over a disabled control contained in it...&lt;/p&gt;&lt;p&gt;so my question is:&lt;/p&gt;&lt;p&gt;Is this the desired behavior, or is it a side effect caused maybe by some tweaking in the event mechanics ? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>