Page 1 of 1

Using DataTemplates to control views

Posted: 17 Jun 2026, 11:04
by Aggro
Hello!
I've been experimenting on best practices for showing views in a MVVM style. So I've set up some DataTemplates that hold the view and use the datatype of my view models.
It took a while to get it to even work in Noesis Studio until I found a thread mentioning that the data template shouldn't contain a x:Key. Removing that made it work at least inside Studio when I switched between the Sub view models in my main view model.

But for some reason I just can't seem to get it to work in Unity so I have a few questions:

1. Is there something I've missed in my setup? (I've attached my test case to the thread)

2. When doing bindings in Noesis Studio using the structures, it binds it to a NoesisInternals namespace that gives me errors inside Unity when trying to run.
Is there a best practice for handling namespaces and bindings towards unity based data?

3. Will there be a way to generate the data created in Noesis Studio into (in my case) a C# class that I can place in unity? Instead of having to set up the data in both places

I've been trying this out with the 4.0 Noesis Studio Unity beta
Thanks in advance!

Re: Using DataTemplates to control views

Posted: 22 Jun 2026, 11:19
by sfernandez
Hello,

1 & 2. The problem here is actually on our side. The default project we create in Unity does not have the DefaultDataNamespace properly set up, causing the namespace to fall back to NoesisStudioInternals. If it is not explicitly set, it should be using the project name instead (we have to fix this).

I see you now have the DefaultDataNamespace set to TestCase in your .noesis project file. Every structure you create will be defined under that namespace now. For your existing setup, you can manually modify the structures and sets that were using NoesisStudioInternals to use your new namespace (the files are simple XML located under the .noesis/data folder).

The general best practice is to ensure your runtime ViewModels in Unity are defined under the exact same namespace as the ones in Studio. To make this easier in the future, we have plans to expose the Namespace directly in the definition of the Design Data Structures: #5026

3. Currently, we don't have a feature to auto-generate C# classes directly from Studio data. But it should be pretty straightforward to write a script that converts the xml definitions into C# classes with the proper getter/setter and INotifyPropertyChanged implementations. We will probably include something like that before releasing the official version of the plugin.

Let us know if adjusting those XML files gets your test case working in Unity!

Re: Using DataTemplates to control views

Posted: 03 Jul 2026, 08:18
by Aggro
Hello again, thank you for the answers!

I managed to get it working after setting up the namespaces correctly! And setting up the DefaultDataNamespace made it a bit more streamlined
I think the future plan of being able to have a bit more control of the namespaces will improve things a lot, especially nice to use that for organization in Studio!

Re: Using DataTemplates to control views

Posted: 08 Jul 2026, 14:17
by dstewart
Hey Aggro, Dorian here!

Starting in 0.3.311-beta, you'll find some super cool new features which will not only allow you to rename your Namespaces directly within Studio, but that also let you leverage this same system to organise your Data Structures and Enums into 'folders' of your choosing:

DataFolders.jpg

1) Now, every Data Structure and Enum in the Data Panel, when clicked, will expose a 'Namespace' Property in its Properties Panel. You can rename your Namespaces directly here.

2) If you want to create a system of Folders and Subfolders, all you need to do is to use period-separation between each level of Folder and Subfolder you wish to see in Studio.

For example:

In the Namespace field for 'MyDataStructure', if you type 'MyProject.Players', it will create a folder structure like this:
MyProject
--Players
------MyDataStructure

Or, in if you typed 'MyProject.Players.Friends' in the 'Namespace' field, it will create a folder structure like this:
MyProject
--Players
------Friends
----------MyDataStructure

Let us know how this works for you! Thanks again for writing to us and for the feedback on this!

- Dorian