Skip to content

Dont create pages' data-context until navigation #1153

Open
@Xiaoy312

Description

@Xiaoy312

What would you like to be added:

   at Uno.Gallery.Sample.CreateData(Type dataType)
   at Uno.Gallery.Sample..ctor(SamplePageAttribute attribute, Type viewType)
   at Uno.Gallery.App.GetSamples()
   at Uno.Gallery.App.AddNavigationItems(NavigationView nv)
   at Uno.Gallery.App.BuildShell()
   at Uno.Gallery.App.OnLaunchedOrActivated()
   at Uno.Gallery.App.OnLaunched(LaunchActivatedEventArgs e)

We are currently instantiating all data-contexts, that we ever need, the moment we are launching the app...
This should've delayed until the navigation actually occurs; build one as we need, and not the whole batch.

Why is this needed: general performance

For which Platform: any

Anything else we need to know?

This should also fix the problem of, data-context being shared between navigation.
Would this may sound correct, it is NOT the behavior we expect.

Additionally, we should also check if themes' and toolkit's weren't suffering the same fate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/consumer-experienceCategorizes issue or PR as related to improving the experience of consumerskind/enhancementNew feature or request.kind/performanceCategorizes issue or PR as related to improving performance (allocations/memory/init/etc)kind/sampleRepresents an issue or PR with a sample

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions