WpfBindingErrors 1.2.0
dotnet add package WpfBindingErrors --version 1.2.0
NuGet\Install-Package WpfBindingErrors -Version 1.2.0
<PackageReference Include="WpfBindingErrors" Version="1.2.0" />
<PackageVersion Include="WpfBindingErrors" Version="1.2.0" />
<PackageReference Include="WpfBindingErrors" />
paket add WpfBindingErrors --version 1.2.0
#r "nuget: WpfBindingErrors, 1.2.0"
#:package WpfBindingErrors@1.2.0
#addin nuget:?package=WpfBindingErrors&version=1.2.0
#tool nuget:?package=WpfBindingErrors&version=1.2.0
Turn WPF binding errors into exceptions
This project is a reusable assembly that converts WPF binding errors into exceptions.
Feel free to include it in your own project.
Content
- Class
BindingException
is the typed exception thrown when a binding error occurs - Static class
BindingExceptionThrower
is the one that throwsBindingException
. - Class
BindingErrorListener
adds a listener toPresentationTraceSources.DataBindingSource
. It raises the eventErrorCatched
whenever a binding error occurs. - Class
ObservableTraceListener
is internal; it's an override ofSystem.Diagnostics.TraceListener
and it raises the eventTraceCatched
whenever a trace is written.
See an example in project SampleWpfApplicationTests
in this repository.
Class diagram
How to use it?
The simplest way is to use BindingExceptionThrower
because it handles everything for you:
BindingExceptionThrower.Attach()
That's all.
Once you called Attach()
, every WPF binding error will raise a BindingException
.
See an example in project SampleWpfApplication
in this repository.
However, if you want to be aware of binding errors without throwing an exception, you can use BindingErrorListener
and attach to the ErrorCatched
event.
using( var listener = new BindingErrorListener())
{
listener.ErrorCatched += msg => Console.WriteLine("Binding error: {0}", msg);
// ...do what you want here...
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on WpfBindingErrors:
Repository | Stars |
---|---|
Drommedhar/DlssUpdater
DlssUpdater is a tool to conveniently configure all 3 instances of DLSS libraries (Upscaling, Ray Reconstruction, Frame Generation) used by your games.
|
Updated to target .NET 8 and .NET Framework 4.8. These are current LTS versions.