I have most of the Label objects in my app bound such that they can be replaced from a webservice.
I store my replacements in a Dictionary. The repla
EDIT:
Actually, all this does is disable the output in the VS output pane. It doesn't actually speed things up.
ORIGINAL:
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:
using System.Diagnostics;
namespace DevBindingErrors
{
///
/// Intercepts all binding error messages. Stops output appearing in VS2010 debug window.
///
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));
}
}
}
The 2nd part is in App.xaml.cs:
using System.Diagnostics;
using System.Windows;
namespace DevBindingErrors
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
public App()
{
PresentationTraceSources.Refresh();
PresentationTraceSources.DataBindingSource.Listeners.Add(new BindingTraceListener());
PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning;
}
}
}
If you want to ignore all binding errors, just comment out the Debug.WriteLine(...) line. (I wouldn't really recommend this though) This will speed up execution as well, without losing the ability to debug the application.
The idea for this solution came from this page, which has more details on trace sources in WPF too.