Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Binding System #27

Closed
azunyuuuuuuu opened this issue May 1, 2012 · 1 comment
Closed

Implement a Binding System #27

azunyuuuuuuu opened this issue May 1, 2012 · 1 comment

Comments

@azunyuuuuuuu
Copy link

A very welcomed addition would be the implementation of a Binding System so we can develop our Applications using fancy design patterns like Model-View-ViewModel. This would significantly increase the speed at which we could develop our UIs and also would lower the amount of code required for GUI heavy applications.

@cwensley
Copy link
Member

This should be implemented now with the latest code.

You can bind to objects directly, or to a DataContext property of a widget, which is hierarchical. E.g. you can set the DataContext on your form, and then bind properties of each control to the data context very easily by way of:

myTextBoxControl.Bind("Text", "MyDataContextProperty", DualBindingMode.TwoWay);

or to a specific object:

myTextBoxControl.Bind("Text", myObjectToBindTo, "MyObjectProperty", DualBindingMode.TwoWay);

If you use DualBindingMode.OneWay, then you can use myForm.UpdateBindings() to update your object model. e.g. if you only want to update the object model when you click a button like 'save'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants