Repository navigation
Description
What would you like to be added:
Provide Names for ALL Navigators that are Defined and therefore should be use-able/call-able by Name using uen:Region.Navigator. Things you will potentially need to change/update:
-
PanelVisibilityNavigator.NavigatorNameis currently the only one with aNavigatorNameProperty:uno.extensions/src/Uno.Extensions.Navigation.UI/Navigators/PanelVisiblityNavigator.cs
Line 7 in 456ee65
public const string NavigatorName = "Visibility"; Possible ways to solve this
- So you should add this either to the Interface to ensure all INavigator's are call-able and registred by Name
possible problem with this option:- neither
const stringnorstatic readonly stringcan be required by Interface
- neither
- define those Names just like in the
PanelVisibilityNavigatorat least for those Navigators Uno provides and make the.AddRegion<T,T>(string name, ...)Property required to be provided, so anyone who wants to Define and Register maybe their own ones (not sure if your Navigation Framework allowes this?) can do so, but has to adhere to this Contract/Signature ofAddRegion.
- So you should add this either to the Interface to ensure all INavigator's are call-able and registred by Name
-
Updating this current Version of
ServiceCollectionExtensions:
uno.extensions/src/Uno.Extensions.Navigation.UI/ServiceCollectionExtensions.cs
Lines 59 to 66 in 456ee65
.AddRegion<Frame, FrameNavigator>() .AddRegion<ContentControl, ContentControlNavigator>() .AddRegion<Panel, PanelVisiblityNavigator>(name: PanelVisiblityNavigator.NavigatorName) .AddRegion<Microsoft.UI.Xaml.Controls.NavigationView, NavigationViewNavigator>() .AddRegion<ContentDialog, ContentDialogNavigator>(true) .AddRegion<MessageDialog, MessageDialogNavigator>(true) .AddRegion<Flyout, FlyoutNavigator>(true) .AddRegion<Popup, PopupNavigator>(true) To this:
.AddRegion<Frame, FrameNavigator>(name: FrameNavigator.NavigatorName) // "Frame" .AddRegion<ContentControl, ContentControlNavigator>(name: ContentControlNavigator.NavigatorName) // "Content" .AddRegion<Panel, PanelVisiblityNavigator>(name: PanelVisiblityNavigator.NavigatorName) // "Visibility" - As-Is .AddRegion<Microsoft.UI.Xaml.Controls.NavigationView, NavigationViewNavigator>(name: NavigationViewNavigator.NavigatorName) // "NavigationView" - Default the requested Content/Data into `NavigationView.Content` removing the *current requirement* to use a nested e.g. Grid for this! .AddRegion<ContentDialog, ContentDialogNavigator>(isRequestRegion: true, name: ContentDialogNavigator.NavigatorName) // "ContentDialog" or "Dialog" .AddRegion<MessageDialog, MessageDialogNavigator>(isRequestRegion: true, name: MessageDialogNavigator.NavigatorName) // "MessageDialog" or "Message" .AddRegion<Flyout, FlyoutNavigator>(isRequestRegion: true, name: FlyoutNavigator.NavigatorName) // "Flyout" .AddRegion<Popup, PopupNavigator>(isRequestRegion: true, name: PopupNavigator.NavigatorName) // "Popup"
Why is this needed:
-
Defintly User Expirience! In the current Navigation Docs
uen:Region.Navigator="Visibility"is the only mentioned available Navigator Name/Id while nobody exactly clarified this to be the Only Option, so this caused already missunderstandents and fails on User side, myself included as I started learning Uno!
This Recent Example Case from our Uno Discord Server made it even more clearer- you should be estimating the User to misunderstand this Property an the Way, that we can Attach it with a Valid Value of
FrameorFrameNavigator, and get a Native Frame Navigation. Of course, those of us who used the Navigation Extensions for longer, will know the difference and I am sure it had been noted somewhere in the Past, but even without assuming this as Native Frame Navigation - you could allow us to attach the FrameNavigator to a real Frame Control and let us archive e.g. on Windows Target the native Frame behaviour (animations, sliding and so on) 🚀 which is so far not the case when using Xaml Navigation 🙁
- you should be estimating the User to misunderstand this Property an the Way, that we can Attach it with a Valid Value of
-
Only the
PanelVisibilityNavigatoris registred with an actual name ("Visibility") (see the ServiceCollectionExtensions Source Link above) -
A Property which is only capable of having one valid Value could also be dropped because it should be the default value in that case, instead of the User have to fail until he recognizes that he needs to set:
-
uen:Region.Attached=true(recursively upwards) -
uen:Region.Navigator="Visibility"<-- ALLWAYS this Name -
AnyControl.Visibility="Collapsed"so you see, with this, we already needed to define that "Visibility" 2x 🙄
For which Platform:
- iOS
- Android
- WebAssembly
- WebAssembly renders for Xamarin.Forms
- Windows
- Desktop
- Build tasks
Anything else we need to know?
Only PanelVisibilityNavigator supports actual Navigation while the NavigationViewNavigator does not consider inserting this by Default into ist Content by Default.
Activity