EisenbergEffect
Topic Author
Posts: 19
Joined: 22 Mar 2013, 15:09

Data Binding in Unity

25 Mar 2013, 22:25

Is databinding in Unity possible at this point? I see that the API requires the the data context inherit from BaseComponent...which is non-standard. What are the implications of this? Do I implement INotifyPropertyChanged on my data context object? or is there some other special practice that is needed?
 
EisenbergEffect
Topic Author
Posts: 19
Joined: 22 Mar 2013, 15:09

Re: Data Binding in Unity

01 Apr 2013, 20:58

Anyone?
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Data Binding in Unity

02 Apr 2013, 01:43

Hi EisenbergEffect, sorry for my late answer.

Data binding is not possible yet in Unity. We were working on this feature so it can be ready for the next update.

The Unity API is a wrapper of NoesisGUI C++ API, where BaseComponent is our base class. In Unity you would have to inherit from this class to be able to use data binding. To notify of property changes we will provide a function that could be called from your class.

We are preparing a tutorial to explain how Data Binding works in Unity.
 
EisenbergEffect
Topic Author
Posts: 19
Joined: 22 Mar 2013, 15:09

Re: Data Binding in Unity

02 Apr 2013, 23:17

Ok. Thanks for the update. When that release comes out....I'm going to hit that thing with everything I've got ;) My goal will be to see if I can bring some of my ideas from Caliburn.Micro into the Noesis/Unity world. I'm looking forward to seeing how things work out.
 
User avatar
jsantos
Site Admin
Posts: 3918
Joined: 20 Jan 2012, 17:18
Contact:

Re: Data Binding in Unity

03 Apr 2013, 11:11

Before releasing, could you describe what kind of data biding are you expecting for Unity? Only to make sure that our implementation is what you want and if not, trying to improve it.

Experience in the unity/xaml ecosystem like the one you have is very importar for us.
 
EisenbergEffect
Topic Author
Posts: 19
Joined: 22 Mar 2013, 15:09

Re: Data Binding in Unity

04 Apr 2013, 04:34

Ultimately, I would like to create a C# class that represents my data model. I'd prefer to not have to inherit from Component, but that's not a deal killer since most view models end up inheriting from some base class in the MS Xaml space. Then, I'd like to be able to set that as the data context (and get it back from the data context later). Then, I would expect binding expressions on arbitrary properties to work against the model. Here's some slightly more advanced scenarios I would love support for:

1. Binding the Content property of content controls and being able to provide a data template for that.
2. Binding the Items property of ItemsControls and being able to provide an items template.
3. Being able to create custom attached properties.

Is that what you are looking for?
 
EisenbergEffect
Topic Author
Posts: 19
Joined: 22 Mar 2013, 15:09

Re: Data Binding in Unity

04 Apr 2013, 04:36

Also...it's important that there is as little "boiler plate" code as possible in creating my view model class. I looked at the tutorial sample for creating custom components...and that felt like a lot of work. Ideally, I would be able to inherit from a base class and then create my own properties, that's it.
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Data Binding in Unity

05 Apr 2013, 02:47

I'd like to be able to set that as the data context (and get it back from the data context later)
Working.
I would expect binding expressions on arbitrary properties to work against the model
As soon as you notify NoesisGUI system of property changes (just as you do when implementing INotifyPropertyChanged), this will work.
1. Binding the Content property of content controls and being able to provide a data template for that.
Already working.
2. Binding the Items property of ItemsControls and being able to provide an items template.
Already working.
3. Being able to create custom attached properties.
Will be working.

;)
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Data Binding in Unity

05 Apr 2013, 02:51

Also...it's important that there is as little "boiler plate" code as possible in creating my view model class. I looked at the tutorial sample for creating custom components...and that felt like a lot of work. Ideally, I would be able to inherit from a base class and then create my own properties, that's it.
Current implementation was done by brute force, to get something working as fast as possible. As you say, we need to provide some "boiler plate" to simplify the code that users should write.

We will try to have a simpler approach ready for one of the first revisions after official release.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 9 guests