[Resolved] WPF Application Binding not working : I must miss something

Mar 10, 2010 at 7:34 AM

Hello,

 

I'm rather new to WPF programming and NHydrate, and I've spent hours to try to make a correct binding between a property of a Nhydrate business object and  a simple textbox.

I've tried the binding in XAML, in code-behind , setting DataContext in various UI elements (including textbox itself), using a Static resource : I can't get my object property bind correctly to textbox text.

I've tried to replace Nhydrate object by a dummy class with same property name and with this it's working, so my problem is linked to business object property.

Can anyone enlighten me about what I miss?

 

Mar 11, 2010 at 9:16 AM

I really missed something....

In fact the name of the column in the database( mixed case) was modified by nhydrate (or by me accidentally ?) to first letter uppercase and other letters lower.

And I did not realize that XAML parsing was case sensitive....

If anyone has some WPF data binding problems my advice is to look at

http://eladm.wordpress.com/2009/04/08/databinding-tips-tricks

to activate display of debug information of your XAML code execution.

 

 

 

 

Coordinator
Mar 11, 2010 at 6:56 PM

The database name of column is turned into Pascal case in the C# code. You should not need to interact with your actual database field at all. If you bind to a business object, its name should be all you need really. If the database name is "customer_id", then your C# object will have a property "CustomerId". That object should bind just fine with the Pascal name.