-
Notifications
You must be signed in to change notification settings - Fork 49
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
Injected INavigator is null for classes not linked to View #2608
Comments
modify to: |
@lhLife .AddTransient does fix the issue but, it's not ideal as it forces developer to use Transient, even if they want a Singleton, I would treat this as temporary work around. I also think that this should be documented in Uno docs for example somewhere on this page https://platform.uno/docs/articles/external/uno.extensions/doc/Reference/Navigation/Navigator.html |
It cannot be a singleton, it can only expose INavigatorFactory or INavigator wrapper。
|
The setting of the region is good, but INavigator needs a wrapper class to solve its complexity. |
Sorry I don't follow, you have two regions with same name ? |
Each page is a separate page. |
Current behavior
I have SomeUtils class that takes
UnoAppNavigation2.zip
in INavigator as ctor parameter, at creation the parameter is null
App.xaml.cs
MainPage.xaml cs getting ISomeUtils class instance
SomeUtils class
Expected behavior
INavigator should not be null when injected to a SomeUtils class
How to reproduce it (as minimally and precisely as possible)
Build and run project attached, put a brakepoint in SomeUtlis class ctor. INavigator parameter will be null.
Workaround
No response
Works on UWP/WinUI
None
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
No response
Affected platforms
Windows (WinAppSDK)
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: