Why does public string name {get; set;} work when binding, but public string name; does not? Why is the getter required when they both return the same string?
Because you can only bind to public properties in WPF. The following is a field and not a property:
public string name;
The binding engine only looks for properties when the binding expressions are evaluated using reflection at runtime.
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