Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT:</p> <p>Actually, all this does is disable the output in the VS output pane. It doesn't actually speed things up.</p> <p>ORIGINAL:</p> <p>I had a similar problem, but I wanted to catch and log the errors. However, you can use the following solution to simply disable outputting the errors to the VS2010 output window. The solution comes in 2 parts, the first is a simple class:</p> <pre><code>using System.Diagnostics; namespace DevBindingErrors { /// &lt;summary&gt; /// Intercepts all binding error messages. Stops output appearing in VS2010 debug window. /// &lt;/summary&gt; class BindingTraceListener: TraceListener { private string _messageType; public override void Write(string message) { // Always happens in 2 stages: first stage writes "System.Windows.Data Error: 40 :" or similar. _messageType = message; } public override void WriteLine(string message) { Debug.WriteLine(string.Format("{0}{1}", _messageType, message)); } } } </code></pre> <p>The 2nd part is in App.xaml.cs:</p> <pre><code>using System.Diagnostics; using System.Windows; namespace DevBindingErrors { /// &lt;summary&gt; /// Interaction logic for App.xaml /// &lt;/summary&gt; public partial class App : Application { public App() { PresentationTraceSources.Refresh(); PresentationTraceSources.DataBindingSource.Listeners.Add(new BindingTraceListener()); PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning; } } } </code></pre> <p>If you want to ignore all binding errors, just comment out the <code>Debug.WriteLine(...)</code> line. (I wouldn't really recommend this though) This will speed up execution as well, without losing the ability to debug the application.</p> <p>The idea for this solution came from <a href="http://blogs.msdn.com/b/mikehillberg/archive/2006/09/14/wpftracesources.aspx" rel="nofollow">this page</a>, which has more details on trace sources in WPF too.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload