Cannot bind to public fields

Dec 20, 2008 at 12:46 PM
Is it by design that only properties can be bound?
When I set the path to a public field it does not work.
Thanks
Glenn
Coordinator
Dec 20, 2008 at 3:05 PM
Public properties and DPs can be bound.  Fields cannot be bound.
Dec 20, 2008 at 8:24 PM
I am deeply sadened ... ;-)
I wonder what made that decision?
Think it will be that way for good?
This causes issues with other components that like fields.  Like oodb's and whatever.
And what is DP?  (Sorry new to WPF) been in the backend far too long.
Thanks
Glenn
Dec 30, 2008 at 7:59 PM
A "DP" is a Dependency Property.

I highly doubt that they'll add support for public fields
Jan 15, 2009 at 9:45 AM
However, you can always add a wrapper DP around a field if you need this sort of functionality. That is usually how they are implemented anyway.

Or, just tack on a {get;set;} after the field declaration, turning it into a .NET property (which like vinsibal points out can be data bound).