Linking XAMLs
Posted: 01 May 2026, 01:25
TLDR:
I'm trying to find a way to split up XAMLs that will work both in Noesis Studio and Runtime.
Premises:
Have a game HUD with distinct sections/modules.
Each section should have its own VM (cpp) and View (XAML).
Assume 1 View for main HUD and 1 sub-View for list of Pawns in Scene, for example.
The problem:
I'm failing to find the right way to link/organize the 2 Views (XAMLs) such that the setup works both in Noesis Studio and Runtime.
So far I managed to put together 4 different ways to do it, each has some issues, none feels right:
1) <Component Source="PawnList.xaml">
- This seems like first class feature of Studio, works perfectly _in Studio_
- Runtime screams `GameplayHUD.xaml(28,5): Unknown element type 'Component'`, can't get this to work
2) <local:PawnList>
- This is standard way I would do it in WPF
- Runtime works when code behind (stub cpp) is provided and the class is registered; pity but works
- Studio renders the sub-XAML but refuses to compose the whole HUD XAML
3) <ContentControl> & DataTemplate
- Runtime works, resolves bound VM type, also very standard in WPF
- Studio renders, but it's impossible to layout-edit ResourceDictionary files
4) <Control Template="PawnListAsControlTemplate">
- Runtime works
- It's again ResourceDictionary so impossible to render and edit individually + pity to link
- Main HUD composes and renders, can be switched to Template-edit mode so technically workable
=> Probably acceptable workflow, but feels like hacking/bending in a way that was not intended
Is there a better/simpler recommended way?
Did I just miss an obvious pattern?
Noesis Studio: v0.2.290
Runtime: Unreal 5.7 & NoesisGUI 3.2.13 (r17073)
I'm trying to find a way to split up XAMLs that will work both in Noesis Studio and Runtime.
Premises:
Have a game HUD with distinct sections/modules.
Each section should have its own VM (cpp) and View (XAML).
Assume 1 View for main HUD and 1 sub-View for list of Pawns in Scene, for example.
The problem:
I'm failing to find the right way to link/organize the 2 Views (XAMLs) such that the setup works both in Noesis Studio and Runtime.
So far I managed to put together 4 different ways to do it, each has some issues, none feels right:
1) <Component Source="PawnList.xaml">
- This seems like first class feature of Studio, works perfectly _in Studio_
- Runtime screams `GameplayHUD.xaml(28,5): Unknown element type 'Component'`, can't get this to work
2) <local:PawnList>
- This is standard way I would do it in WPF
- Runtime works when code behind (stub cpp) is provided and the class is registered; pity but works
- Studio renders the sub-XAML but refuses to compose the whole HUD XAML
3) <ContentControl> & DataTemplate
- Runtime works, resolves bound VM type, also very standard in WPF
- Studio renders, but it's impossible to layout-edit ResourceDictionary files
4) <Control Template="PawnListAsControlTemplate">
- Runtime works
- It's again ResourceDictionary so impossible to render and edit individually + pity to link
- Main HUD composes and renders, can be switched to Template-edit mode so technically workable
=> Probably acceptable workflow, but feels like hacking/bending in a way that was not intended
Is there a better/simpler recommended way?
Did I just miss an obvious pattern?
Noesis Studio: v0.2.290
Runtime: Unreal 5.7 & NoesisGUI 3.2.13 (r17073)