2011-07-19, 07:30 PM
I'm reluctant to post a more general cry for C# help, rather than something NPVR specific, but does anyone have any simple examples of using data binding to reduce the amount of code required when buildings forms (for the Settings dialog)?
The stuff I've done so far has always been (old skool java style):
And then the form is built with:
And when it's time to save everything:
Data binding sounds like it might be a simpler way to do this? But I'm not sure if it can work without complex datagrid this or bindingsource that, rather than my micky mouse collection of statically declared variables (that makes it easy to get at them elsewhere in the actual plugin).
Iain
The stuff I've done so far has always been (old skool java style):
Code:
class MySettings
{
static string someTextValue= <read from xml file>
}
And then the form is built with:
Code:
SomeTextBox.Text = MySettings.someTextValue;
Code:
MySettings.someTextValue= SomeTextBox.Text;
Data binding sounds like it might be a simpler way to do this? But I'm not sure if it can work without complex datagrid this or bindingsource that, rather than my micky mouse collection of statically declared variables (that makes it easy to get at them elsewhere in the actual plugin).
Iain