<?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>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/159492.aspx</link><pubDate>Mon, 12 Jan 2009 15:21:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:159492</guid><dc:creator>jsawruk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/159492.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=159492</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I have created a sample Silverlight app, but I don&amp;#39;t know how to to attach it to this post. If you email me, I&amp;#39;ll send it to you.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I could NOT reproduce it within the sample project though. Something weird is going on. I can&amp;#39;t release the source code of the project that is giving me the problem though...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158419.aspx</link><pubDate>Fri, 09 Jan 2009 16:07:41 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158419</guid><dc:creator>jsawruk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158419.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158419</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;New data:&lt;/p&gt;&lt;p&gt;&amp;nbsp;ActualHeight and ActualWidth are reporting correctly.&lt;/p&gt;&lt;p&gt;If I change the Grid to a StackPanel, I still get the error.&amp;nbsp;&lt;/p&gt;&lt;p&gt;As far as XAML and C# code, I&amp;#39;ll try to put together a simplified example. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158048.aspx</link><pubDate>Thu, 08 Jan 2009 22:16:58 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158048</guid><dc:creator>bryant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158048.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158048</wfw:commentRss><description>&lt;p&gt;Can you post the full Xaml and code that you&amp;#39;re using to replicate this (simplified if possible)? I&amp;#39;d be curious to see it and debug it.&lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158036.aspx</link><pubDate>Thu, 08 Jan 2009 22:05:38 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158036</guid><dc:creator>jsawruk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158036.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158036</wfw:commentRss><description>&lt;p&gt;I too thought it might be a layout issue, but so far I haven&amp;#39;t figured out how or what might be causing that. I explicitly set dimensions on the Grid objects. I tried setting different backgrounds, but they all seem to fit like they should. I&amp;#39;ll have to keep experimenting though. Maybe I should convert the Grids into StackPanels.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158031.aspx</link><pubDate>Thu, 08 Jan 2009 21:48:28 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158031</guid><dc:creator>bryant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158031.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158031</wfw:commentRss><description>&lt;p&gt;Hmm.. Then there is probably something going on with your layout that isn&amp;#39;t expected. I&amp;#39;d try putting some backgrounds on the grids to see how much space they are actually taking up. Sounds like somehow the bottom Grid is overlapping the top Grid and causing it to fire the click event. &lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158030.aspx</link><pubDate>Thu, 08 Jan 2009 21:46:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158030</guid><dc:creator>jsawruk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158030.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158030</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I checked sender, and that to is simply coming from the wrong control.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/158026.aspx</link><pubDate>Thu, 08 Jan 2009 21:40:49 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:158026</guid><dc:creator>bryant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/158026.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=158026</wfw:commentRss><description>&lt;p&gt;Hmm.. That is interesting. What if you check the value of sender instead of e.OriginalSource? I generally always use the sender if I want to determine what was clicked.&lt;/p&gt;</description></item><item><title>Problem with Message Passing / Event Handling</title><link>http://forums.silverlight.net/forums/thread/157870.aspx</link><pubDate>Thu, 08 Jan 2009 16:59:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:157870</guid><dc:creator>jsawruk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/157870.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=157870</wfw:commentRss><description>&lt;p&gt;I am not sure if this is a bug or not, but I am getting strange behavior with some events.&lt;/p&gt;&lt;p&gt;I have a StackPanel. Inside of the StackPanel are a number of Grids. Each Grid is one row high and two columns wide. The first column contains a graphic, and the second column contains text, like this:&lt;/p&gt;&lt;p&gt;(img) Label 1&lt;br /&gt;(img) Label 2&lt;/p&gt;&lt;p&gt;etc.&lt;/p&gt;&lt;p&gt;&amp;nbsp;(I could in theory use StackPanels instead of Grids, but I have decided to use Grids).&lt;/p&gt;&lt;p&gt;The XAML is: &lt;br /&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;Grid&lt;/span&gt;&lt;span class="attr"&gt; x:Name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; MouseLeftButtonDown=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;LayoutRoot_MouseLeftButtonDown&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Height=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Width=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;250&amp;quot;&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;Grid.RowDefinitions&lt;/span&gt;&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;RowDefinition&lt;/span&gt; /&amp;gt;
        &amp;lt;/&lt;span class="tag"&gt;Grid.RowDefinitions&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;Grid.ColumnDefinitions&lt;/span&gt;&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;ColumnDefinition&lt;/span&gt;&lt;span class="attr"&gt; Width=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;20&amp;quot;&lt;/span&gt; /&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;ColumnDefinition&lt;/span&gt;&lt;span class="attr"&gt; Width=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;5&amp;quot;&lt;/span&gt; /&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;ColumnDefinition&lt;/span&gt;&lt;span class="attr"&gt; Width=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;*&amp;quot;&lt;/span&gt; /&amp;gt;
        &amp;lt;/&lt;span class="tag"&gt;Grid.ColumnDefinitions&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;Rectangle&lt;/span&gt;&lt;span class="attr"&gt; Height=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;5&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Width=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;20&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Fill=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Black&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Grid.Column=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Grid.Row=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; x:Name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Rect&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="tag"&gt;Rectangle&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;TextBlock&lt;/span&gt;&lt;span class="attr"&gt; Text=&amp;quot;&amp;quot; Grid.Column=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Grid.Row=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; x:Name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;txtLabel&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="tag"&gt;TextBlock&lt;/span&gt;&amp;gt;
    &amp;lt;/&lt;span class="tag"&gt;Grid&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;A user clicks on any of the text or images, triggering further events.&lt;/p&gt;&lt;p&gt;Here&amp;#39;s the problem&lt;/p&gt;&lt;p&gt;Let&amp;#39;s say there are three grids: 1, 2, 3.&lt;/p&gt;&lt;p&gt;A user clicks on the top most grid (#1).&lt;/p&gt;&lt;p&gt;But in the MouseLeftButtonDown handler, the value of e.OriginalSource says that the click originated from grid #3.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Clearly this causes all sorts of unusual behavior. I have successfully reproduced this several times, but have yet to understand what is causing this to occur. Any help would be greatly appreciated.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>