SetDataContext in 1.2 for Unity
Hi,
I'm trying to get 1.2 for Unity to work with binding to my viewmodel, but nothing seem to work anymore.
Previously, I would use this:
Now:
- "GetRoot" doesn't work anymore (replaced by GetContent? MonoDevelop doesn't recognize GetContent but Unity compiler does...)
- "SetDataContext" is recognized by MonoDevelop, but Unity compiler doesn't accept this.
Help!?
I'm trying to get 1.2 for Unity to work with binding to my viewmodel, but nothing seem to work anymore.
Previously, I would use this:
Code: Select all
ModelView _modelView = new ModelView(_manager);
NoesisGUIPanel noesisGUI = GetComponent<NoesisGUIPanel>();
Noesis.Grid grid = noesisGUI.GetRoot<Noesis.Grid>();
grid.SetDataContext (_modelView);
- "GetRoot" doesn't work anymore (replaced by GetContent? MonoDevelop doesn't recognize GetContent but Unity compiler does...)
- "SetDataContext" is recognized by MonoDevelop, but Unity compiler doesn't accept this.
Help!?
-
-
sfernandez
Site Admin
- Posts: 2062
- Joined:
Re: SetDataContext in 1.2 for Unity
Hi,
Yes, 1.2 API tries to follow WPF API as much as possible, so we had to change lots of things. The most important changes are remarked in the changelog.
The code you posted should look like this now:
I guess if you fix all compiler errors and Sync your MonoDevelop project, it would recognize the new API correctly.
Yes, 1.2 API tries to follow WPF API as much as possible, so we had to change lots of things. The most important changes are remarked in the changelog.
The code you posted should look like this now:
Code: Select all
ModelView _modelView = new ModelView(_manager);
NoesisGUIPanel noesisGUI = GetComponent<NoesisGUIPanel>();
Noesis.Grid grid = (Noesis.Grid)noesisGUI.GetContent();
grid.DataContext = _modelView;
Who is online
Users browsing this forum: Google [Bot] and 0 guests