brianallen
Topic Author
Posts: 1
Joined: 19 Oct 2026, 02:07

Best Practices for Organizing XAML Files in a Growing Project

19 Oct 2026, 02:10

Hi everyone,

I'm new to the NoesisGUI community and currently learning how to organize UI projects properly. I'm curious how you experienced users structure your XAML files when working on a larger game project.

Do you usually keep each screen in a separate XAML file and share common styles and templates through resource dictionaries, or do you prefer a different approach?

I'd also like to know how you handle reusable controls and keep bindings manageable as the project grows. I'm hoping to avoid ending up with too many duplicated styles and complicated dependencies between screens.

Any examples or tips from your own projects would be greatly appreciated. Thanks!
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: Best Practices for Organizing XAML Files in a Growing Project

20 Oct 2026, 11:20

Hello and welcome!

We generally recommend structuring large projects by following a MVVM approach, and using DataTemplates to represent the data. Those templates can then be used in ContentControls or ItemsControls:
  • Explicitly, by setting the template in the ContentTemplate or ItemTemplate properties.
  • Implicitly, by defining the DataTemplate without a key and specifying the DataType they represent (what we call 'default data template' for a type/data structure). Our LayeredUI sample follows that approach.
You can define different templates for each screen, like we do in our Menu3D sample included in any SDK (Native, Unity or Unreal). To organize your templates, they can be stored into several ResourceDictionaries and merged into the GlobalResources.

On another level of complexity, in case you want to have a total control of what gets loaded in your game, you can have a master XAML where you can insert manually loaded XAML pages, and merge new dictionaries to the GlobalResources as they are required.

Let me know if you want to dig into the details for any of this. Happy to help!

Who is online

Users browsing this forum: No registered users and 9 guests