I've just learnt (the hard way) that databinding doesn't work with fields. This isn't a problem given how easy automatic properties are, but I was wondering why this is the case. Can anyone explain?
I found a good explanation here:
... because public fields are not a recommended practice. While they maybe convenient for quick and dirty code, they do not version. Using properties instead allows you to change the access logic, and data storage behind the covers, as well as add validation logic when a value is assigned. Furthermore, accessing properties feels pretty much the same, and do not have any performance overhead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With