-
- laurawoods
- Posts: 1
- Joined:
- Contact:
Does disabling NoesisView really defer XAML initialization?
Hi,
I'm testing NoesisGUI 4.0 with Unity and noticed something I would like to verify.
I have a NoesisView containing a relatively large UI:
37 XAML files
214 styles/resources
12 custom controls
View starts with enabled = false
On my test machine, entering Play Mode still increases memory by about 28–32 MB before the view is enabled.
When I enable the same view, the first display takes another 85–110 ms.
My question is:
Does disabling NoesisView actually defer the Noesis/XAML initialization, or are referenced XAML dependencies already processed by Unity/Noesis before the View becomes enabled?
If this is expected behavior, what is the recommended pattern in NoesisGUI 4.0 for keeping a large UI completely unloaded until the player actually opens it?
Thanks!
I'm testing NoesisGUI 4.0 with Unity and noticed something I would like to verify.
I have a NoesisView containing a relatively large UI:
37 XAML files
214 styles/resources
12 custom controls
View starts with enabled = false
On my test machine, entering Play Mode still increases memory by about 28–32 MB before the view is enabled.
When I enable the same view, the first display takes another 85–110 ms.
My question is:
Does disabling NoesisView actually defer the Noesis/XAML initialization, or are referenced XAML dependencies already processed by Unity/Noesis before the View becomes enabled?
If this is expected behavior, what is the recommended pattern in NoesisGUI 4.0 for keeping a large UI completely unloaded until the player actually opens it?
Thanks!
Re: Does disabling NoesisView really defer XAML initialization?
Hello Laura,
Nothing has changed regarding this in 4.0. If you are observing something different, please let us know so we can investigate further.
The root XAML of the view is loaded in View.LoadXaml, which is called when the NoesisView component is enabled. If the component is not enabled, the XAML content should not be loaded. Depending on the content of the root XAML, other XAML files may be loaded as well.
This is related to the creation of the visual tree. However, since the XAML assets are Unity resources, Unity keeps the assets in memory (just the raw XAML). This shouldn't consume a significant amount of memory, but if you need more granularity here, you could manage the assets using Addressables.
Nothing has changed regarding this in 4.0. If you are observing something different, please let us know so we can investigate further.
The root XAML of the view is loaded in View.LoadXaml, which is called when the NoesisView component is enabled. If the component is not enabled, the XAML content should not be loaded. Depending on the content of the root XAML, other XAML files may be loaded as well.
This is related to the creation of the visual tree. However, since the XAML assets are Unity resources, Unity keeps the assets in memory (just the raw XAML). This shouldn't consume a significant amount of memory, but if you need more granularity here, you could manage the assets using Addressables.
Who is online
Users browsing this forum: No registered users and 14 guests