I’m new to c# and I’m looking for a way to bind a property of an object of my own to the value of a textbox in a regular form (reset the property of the object everytime the value of the input changes).
I have read some information and it seems that this can be done only for database objects. Can you give me additional information.
Assuming you mean Windows Forms textbox,
say
whenever you feel like binding it. Bindings are usually done in
Form_Loadevent handler, if the object can be obtained at that time of course, and if there’s no complex logic with different data sources.Note that this will only work in one direction (changing TextBox will yield object property changes). To sync the other way round, the object must implement
INotifyPropertyChangedinterface.