winforms_databinding_sample
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
winforms_databinding_sample [2018/07/29 05:12] – wolfgangriedmann | winforms_databinding_sample [2018/07/29 05:28] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 5: | Line 5: | ||
As usual, it requires at least one line of code for every field: | As usual, it requires at least one line of code for every field: | ||
- | < | + | < |
where '' | where '' | ||
It is very easy to implement name based binding in WinForms. You need a similar method of ther following in your window: | It is very easy to implement name based binding in WinForms. You need a similar method of ther following in your window: | ||
- | < | + | < |
local oControls as System.Windows.Forms.Control.ControlCollection | local oControls as System.Windows.Forms.Control.ControlCollection | ||
local oTextBox as TextBox | local oTextBox as TextBox | ||
Line 25: | Line 25: | ||
return</ | return</ | ||
and then you can combine your form (or View as in MVVM) with a simple statement: | and then you can combine your form (or View as in MVVM) with a simple statement: | ||
- | < | + | < |
Of course you should enhance your method to implement databinding also for the other types of controls you use, and you should put them in your windows base class from which all your forms/Views will be inherited. | Of course you should enhance your method to implement databinding also for the other types of controls you use, and you should put them in your windows base class from which all your forms/Views will be inherited. | ||
+ | |||
+ | A sample as XIDE export file can be found here: {{ : | ||
winforms_databinding_sample.1532841169.txt.gz · Last modified: 2018/07/29 05:12 by wolfgangriedmann