A lightweight library that converts WPF binding errors into exceptions, so you can quickly spot errors in the XAML markup and detect them unit tests.
All it requires is a single line in your existing code:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs args)
{
base.OnStartup(args);
// Start listening for WPF binding error.
// After that line, a BindingException will be thrown each time
// a binding error occurs.
BindingExceptionThrower.Attach();
}
}
With .NET CLI
> dotnet add package WpfBindingErrors
With Package Manager:
PM> Install-Package WpfBindingErrors
https://www.nuget.org/packages/WpfBindingErrors
- Project WpfBindingError is a reusable assembly that listens for binding errors.
- Project SampleWpfApplication shows how to throw
BindingException
at runtime. - Project SampleWpfApplicationTests shows how to check binding errors in a unit test project.
Each project contains a dedicated README with more detail.
- .NET Core 3.0 🆕
- .NET Framework 4.6
- .NET Framework 4.5.2
- .NET Framework 4.5.1
- .NET Framework 4.5
- .NET Framework 4.0