<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How can I debug WPF bindings?</title>
	<atom:link href="http://bea.stollnitz.com/blog/?feed=rss2&#038;p=52" rel="self" type="application/rss+xml" />
	<link>http://bea.stollnitz.com/blog/?p=52</link>
	<description>on Silverlight and WPF</description>
	<lastBuildDate>Thu, 22 Jul 2010 20:56:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andy</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-199624</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Thu, 15 Apr 2010 10:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-199624</guid>
		<description>thanx dude, veeeery welcome, i&#039;ve spend whole day breaking my poor head ;-)! god bless u pal, andy</description>
		<content:encoded><![CDATA[<p>thanx dude, veeeery welcome, i&#8217;ve spend whole day breaking my poor head ;-)! god bless u pal, andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-170255</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Fri, 20 Nov 2009 19:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-170255</guid>
		<description>Hi Van Nguyen,

No, it&#039;s not possible to handle exceptions from the rendering thread, but I never came across a scenario that required it. The rendering thread contains native code that is responsible only for the actual rendering of the app, it doesn&#039;t not contain any user code. I never encountered an exception thrown in the rendering thread.

The scenario you describe is executed on the UI threaad. You should be able to catch exceptions on the UI thread as usual (try/catch).

Bea</description>
		<content:encoded><![CDATA[<p>Hi Van Nguyen,</p>
<p>No, it&#8217;s not possible to handle exceptions from the rendering thread, but I never came across a scenario that required it. The rendering thread contains native code that is responsible only for the actual rendering of the app, it doesn&#8217;t not contain any user code. I never encountered an exception thrown in the rendering thread.</p>
<p>The scenario you describe is executed on the UI threaad. You should be able to catch exceptions on the UI thread as usual (try/catch).</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-169996</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Thu, 19 Nov 2009 00:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-169996</guid>
		<description>Hi David,

That is strange - it never happened to me. Data binding debugging messages should just show up in the output window, both in WPF and Silverlight.
You mentioned the &quot;Immediate Window&quot; - please keep in mind that the debug messages show up in the &quot;Output Window&quot;.

Bea</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>That is strange &#8211; it never happened to me. Data binding debugging messages should just show up in the output window, both in WPF and Silverlight.<br />
You mentioned the &#8220;Immediate Window&#8221; &#8211; please keep in mind that the debug messages show up in the &#8220;Output Window&#8221;.</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-169994</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Thu, 19 Nov 2009 00:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-169994</guid>
		<description>Hi Pete,

&gt; I can’t find any documentation to say tell me if this would only be effective in a debug build, presumably not – can anyone confirm?
Tracing is actually not a WPF feature - it was around in .NET before WPF used it. From what I could understand in the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/x5952w0c.aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN documentation&lt;/a&gt;, Trace output happens for both debug and release builds. This should be easy for you to try with your application - is this what you see?
There may be better ways to avoid debug output from being generated in release builds, but you can always wrap the trace listener code you show above with an #if DEBUG.

&gt; And if it is effective regardless of the build then is it going to have a performance impact?
Yes, it will certainly affect performance.

&gt; Also – would a knock on effect of this be that anything less than SourceLevels.Error would not got to any trace listener?
That is correct.

Bea</description>
		<content:encoded><![CDATA[<p>Hi Pete,</p>
<p>&gt; I can’t find any documentation to say tell me if this would only be effective in a debug build, presumably not – can anyone confirm?<br />
Tracing is actually not a WPF feature &#8211; it was around in .NET before WPF used it. From what I could understand in the <a href="http://msdn.microsoft.com/en-us/library/x5952w0c.aspx" rel="nofollow">MSDN documentation</a>, Trace output happens for both debug and release builds. This should be easy for you to try with your application &#8211; is this what you see?<br />
There may be better ways to avoid debug output from being generated in release builds, but you can always wrap the trace listener code you show above with an #if DEBUG.</p>
<p>&gt; And if it is effective regardless of the build then is it going to have a performance impact?<br />
Yes, it will certainly affect performance.</p>
<p>&gt; Also – would a knock on effect of this be that anything less than SourceLevels.Error would not got to any trace listener?<br />
That is correct.</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Bethune</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-168783</link>
		<dc:creator>David Bethune</dc:creator>
		<pubDate>Thu, 05 Nov 2009 12:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-168783</guid>
		<description>I should add that I am not doing Office dev. This is a Silverlight 3 project.</description>
		<content:encoded><![CDATA[<p>I should add that I am not doing Office dev. This is a Silverlight 3 project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete Maher</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-168782</link>
		<dc:creator>Pete Maher</dc:creator>
		<pubDate>Thu, 05 Nov 2009 12:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-168782</guid>
		<description>In order to have any data binding exceptions trapped by our application and displayed in our normal error UI I am doing the following at startup:

            WpfTraceListener traceListener = new WpfTraceListener();

            PresentationTraceSources.Refresh();
            PresentationTraceSources.DataBindingSource.Listeners.Add(traceListener);
            PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error;

and the WpfTraceListener.WriteLine shows the message parameter in our Error dialog.

I can&#039;t find any documentation to say tell me if this would only be effective in a debug build, presumably not - can anyone confirm?
And if it is effective regardless of the build then is it going to have a performance impact?
Also - would a knock on effect of this be that anything less than SourceLevels.Error would not got to any trace listener?

Basically I feel backed into a corner and want to know if it is reasonable to do what I have done.
* If I don&#039;t do the above then any exceptions which don&#039;t get noticed during development - either because someone&#039;s eye was not on the Output window or because the exception condition never arose - will not surface in any immediately obvious way during use of the release version of the application.
* If I include the code above will my application be punished with poorer performance?

Pete.</description>
		<content:encoded><![CDATA[<p>In order to have any data binding exceptions trapped by our application and displayed in our normal error UI I am doing the following at startup:</p>
<p>            WpfTraceListener traceListener = new WpfTraceListener();</p>
<p>            PresentationTraceSources.Refresh();<br />
            PresentationTraceSources.DataBindingSource.Listeners.Add(traceListener);<br />
            PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error;</p>
<p>and the WpfTraceListener.WriteLine shows the message parameter in our Error dialog.</p>
<p>I can&#8217;t find any documentation to say tell me if this would only be effective in a debug build, presumably not &#8211; can anyone confirm?<br />
And if it is effective regardless of the build then is it going to have a performance impact?<br />
Also &#8211; would a knock on effect of this be that anything less than SourceLevels.Error would not got to any trace listener?</p>
<p>Basically I feel backed into a corner and want to know if it is reasonable to do what I have done.<br />
* If I don&#8217;t do the above then any exceptions which don&#8217;t get noticed during development &#8211; either because someone&#8217;s eye was not on the Output window or because the exception condition never arose &#8211; will not surface in any immediately obvious way during use of the release version of the application.<br />
* If I include the code above will my application be punished with poorer performance?</p>
<p>Pete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Bethune</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-168781</link>
		<dc:creator>David Bethune</dc:creator>
		<pubDate>Thu, 05 Nov 2009 12:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-168781</guid>
		<description>Brandon &amp; Bea,

I have Brandon&#039;s problem! There were some databinding messages from a previous run in my Immediate window, but now NONE get written there. The only diag info shown is the Silverlight loading messages.

I resent the profile to the General Dev. defaults to make sure I hadn&#039;t kicked something off accidentally.... still no debugging messages at all.

Help!  :-)

Thanks,
-- D</description>
		<content:encoded><![CDATA[<p>Brandon &amp; Bea,</p>
<p>I have Brandon&#8217;s problem! There were some databinding messages from a previous run in my Immediate window, but now NONE get written there. The only diag info shown is the Silverlight loading messages.</p>
<p>I resent the profile to the General Dev. defaults to make sure I hadn&#8217;t kicked something off accidentally&#8230;. still no debugging messages at all.</p>
<p>Help!  :-)</p>
<p>Thanks,<br />
&#8211; D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bea</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-166458</link>
		<dc:creator>Bea</dc:creator>
		<pubDate>Sun, 11 Oct 2009 19:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-166458</guid>
		<description>Hi Brandon,

There is no special setup for the binding debug messages to appear in the output window - they just show up there. I haven&#039;t tried your scenario, but yes, it&#039;s possible that they don&#039;t come up because you&#039;re using ElementHost. Maybe you can try the trace source or trace level debugging solutions?

Bea</description>
		<content:encoded><![CDATA[<p>Hi Brandon,</p>
<p>There is no special setup for the binding debug messages to appear in the output window &#8211; they just show up there. I haven&#8217;t tried your scenario, but yes, it&#8217;s possible that they don&#8217;t come up because you&#8217;re using ElementHost. Maybe you can try the trace source or trace level debugging solutions?</p>
<p>Bea</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-166118</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Wed, 07 Oct 2009 18:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-166118</guid>
		<description>Hi, this seems like an incredibly helpful set of recommendations.  However, I can&#039;t get the Output window in Visual Studio to display ANY of the messages you&#039;re talking about.  

Could this be because I&#039;m working on an Office plugin (VSTO) with WPF controls embedded in an ElementHost?  Or is there something else I&#039;m not enabling? 

I have turned on  PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Verbose;

Brandon</description>
		<content:encoded><![CDATA[<p>Hi, this seems like an incredibly helpful set of recommendations.  However, I can&#8217;t get the Output window in Visual Studio to display ANY of the messages you&#8217;re talking about.  </p>
<p>Could this be because I&#8217;m working on an Office plugin (VSTO) with WPF controls embedded in an ElementHost?  Or is there something else I&#8217;m not enabling? </p>
<p>I have turned on  PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Verbose;</p>
<p>Brandon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vb</title>
		<link>http://bea.stollnitz.com/blog/?p=52&#038;cpage=1#comment-163220</link>
		<dc:creator>vb</dc:creator>
		<pubDate>Fri, 11 Sep 2009 16:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://bea.stollnitz.com/blog/?p=52#comment-163220</guid>
		<description>Thanks for the idea about the no-op converter that is very helpful in times when I am getting the debug output but still can&#039;t seem to track down what is actually going on. Its nice to have another avenue to gather more info. Thanks for writing up this article!</description>
		<content:encoded><![CDATA[<p>Thanks for the idea about the no-op converter that is very helpful in times when I am getting the debug output but still can&#8217;t seem to track down what is actually going on. Its nice to have another avenue to gather more info. Thanks for writing up this article!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
