- EisenbergEffect
- Posts: 19
- Joined:
Data Binding in Unity
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?
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: Data Binding in Unity
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.
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
- Posts: 19
- Joined:
Re: Data Binding in Unity
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.
Re: Data Binding in Unity
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.
Experience in the unity/xaml ecosystem like the one you have is very importar for us.
- EisenbergEffect
- Posts: 19
- Joined:
Re: Data Binding in Unity
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?
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
- Posts: 19
- Joined:
Re: Data Binding in Unity
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.
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: Data Binding in Unity
Working.I'd like to be able to set that as the data context (and get it back from the data context later)
As soon as you notify NoesisGUI system of property changes (just as you do when implementing INotifyPropertyChanged), this will work.I would expect binding expressions on arbitrary properties to work against the model
Already working.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.
Will be working.3. Being able to create custom attached properties.
-
sfernandez
Site Admin
- Posts: 3184
- Joined:
Re: Data Binding in Unity
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.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.
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: No registered users and 2 guests