Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navigation] Variation in the shell page .xaml mark up, influence whether a shell pages and shellModel ctors are called. #2163

Open
3 of 15 tasks
MarkAllan007 opened this issue Feb 4, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@MarkAllan007
Copy link

MarkAllan007 commented Feb 4, 2024

Current behavior

Expected Behavior

How to reproduce it (as minimally and precisely as possible)

Environment

Nuget Package (s), Package Version(s):

Affected platform(s):

  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Android
  • WebAssembly
  • Windows
  • Skia (WPF)
  • Skia (GTK on Linux/macOS/Windows)
  • Skia (Linux Framebuffer)
  • Build tasks

Visual Studio:

  • 2019 (version: )
  • [X ] 2022 (version: )
  • Visual Studio Code (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

@MarkAllan007 MarkAllan007 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Feb 4, 2024
@MarkAllan007 MarkAllan007 changed the title Variation in the shell page .xaml market, influence whether a Shell's ShellModel is created. Variation in the shell page .xaml mark up, influence whether a shell pages and shellModel ctors are called. Feb 4, 2024
@MarkAllan007
Copy link
Author

Current behavior

Create a Uno app using the wizard. Include WinUI 3, WASM and GDK. Presentation MVUX, Xaml, any Theme. DI, Config, HTTP, Localization. ToolKit, Server, PWA M, CPM, Serilog or Default.

The Shell page .xaml should contain the markup to load the Uno Logo screen. Compile this app, place a break in the ShellModel ctor or run the app.

On launching the app, the ShellModel ctor should be called.

Replase the Shell page .xaml mark up with grid and text controls to display "Hello World!". Comment out the references to ContentControl. Put a break in the ShellModel ViewModel ctor. Compile and run the app. The ShellModel ctor is not created /instanciated.

Expected behavior

Both the Shell and ShellModel ctors should be called. The Shell pages .xaml mark up should not stop the ShelModel ctor from being instanciated, yes?

The ShellModels ctor is not called.

Thanks,
Mark Allan

@nickrandolph nickrandolph changed the title Variation in the shell page .xaml mark up, influence whether a shell pages and shellModel ctors are called. [Navigation] Variation in the shell page .xaml mark up, influence whether a shell pages and shellModel ctors are called. May 7, 2024
@nickrandolph
Copy link
Contributor

Hi @MarkAllan007
We need to document the behaviour of Shell but essentially it needs to implement IContentControlProvider which means it needs to return a ContentControl where the navigation for the application will take place.
It's also worth nothing that unlike other pages/viewmodels, the shell viewmodel is actually closer to a service as it is a singleton that is useful for registering application lifecycle events, rather than for data binding to in the shell
I'm going to leave this issue open for now so that we ensure this is documented for Navigation.

@xperiandri
Copy link

In our case we have multiple shells depending on user role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

4 participants