JmD
Topic Author
Posts: 7
Joined: 17 Oct 2013, 13:05

Data binding through interface

29 Oct 2013, 01:14

Are there any plans for making data binding possible by any other way than inheriting from BaseComponent?
For example by implementing an interface (in the same way as INotifyPropertyChanged)?
The need to inherit from BaseComponent really limits the flexibility of how to construct the classes to bind to.

Aside from the above I find your GUI-plugin to be really excellent so far. Congrats on an impressive technique.

///JmD
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Data binding through interface

29 Oct 2013, 12:00

Hi JmD,

Could you please explain which are the limitations you are facing by the necessity of inheriting from BaseComponent?

Maybe we can find a way to solve these limitations.

P.S. Thanks for the nice words :)
 
JmD
Topic Author
Posts: 7
Joined: 17 Oct 2013, 13:05

Re: Data binding through interface

30 Oct 2013, 08:03

Hello sfernandez,

Thank you for your quick reply. It is always impressive to see such commitment to the users from the developer.

One limiting factor is that my classes need to inherit from MonoBehaviour. I could "break out" all the properties from my classes that I want to data bind to, and put them in separate classes that inherits from BaseComponent. Then I could use composition and "put them back in" again. But that means I need to restructure my complete framework which is something I would like to avoid if possible. But maybe that is the way I need to go?

///JmD
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Data binding through interface

30 Oct 2013, 11:29

yes, for now the best approach is using composition. In fact, at first, I would say that even the code is better this way because you separate different concepts (unity script, data binding) in different classes. Could you please post a sample of those behaviours you have that need to be the source of binding?

Anyway, we have to think more about this because this is a deviation from WPF, thing we try to avoid Whenever possible.

Who is online

Users browsing this forum: No registered users and 0 guests