-
- brianallen
- Posts: 1
- Joined:
Best Practices for Organizing XAML Files in a Growing Project
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!
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!
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Best Practices for Organizing XAML Files in a Growing Project
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:
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!
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.
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