Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a complete newbie to WPF.

I am experimenting with binding.

Basically I set the DataContext in the constructor of the XAML file

Basically I create a .xaml form and set a Textbox binding in XAML by adding the following between the <textbox> tag:

Text="{Binding Path=someProperty}"


When I load the form up, I see the value of "someProperty" in the textbox.

No problem.

If "someProperty" doesn't exist, no error is flagged.

Is there a way to generate an error if the property cannot be found?
Posted

The Data Binding errors will be thrown like warning in the Output Window. You can open the Output Window in Visual Studio and check the error.

Here[^] is another example to listen these error.

or you can try Debugging Trick in XAML DataBinding[^] too

Mark it as Answer if it is helpful
 
Share this answer
 
v2
You can control validations with binding - see here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900