// This should result in a Tabbed Page with ViewA & ViewB as tabs and ViewB as the selected Tab...
// ViewC should be a Modal over the TabbedPage
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC");
// If we're improving things... then this should create a tab with a NavigationPage with the root ViewB and current page as ViewD...
// The select tab should be able to distinguish it by NavigationPage unless more than one tab has a NavigationPage..
// otherwise it should distinguish which tab by either the root or current which ever matches...
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=NavigationPage/ViewB/ViewC/ViewD&selectedTab={NavigationPage|ViewB|ViewD}");
// Second note here that was actually invalid and should not be supported... as the first actual `/` should be treated as an entirely new segment
// all query parameters should be URL Encoded...
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=NavigationPage%2FViewB%2FViewC%2FViewD&selectedTab={NavigationPage|ViewB|ViewD}");
-
Current state:
- using the workaround style url defies standard Prism logic and crashes on navigation (https://tomobiledevs.com/MainPage?selectedTab=ItemsPage/ItemDetailPage?Id=2)
[MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage. [MonoDroid] at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.INavigation.PushAsync (Xamarin.Forms.Page root, System.Boolean animated) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:145 [MonoDroid] at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.INavigation.PushAsync (Xamarin.Forms.Page root) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:140 [MonoDroid] at Xamarin.Forms.Internals.NavigationProxy.set_Inner (Xamarin.Forms.INavigation value) [0x0009e] in D:\a\1\s\Xamarin.Forms.Core\NavigationProxy.cs:45 [MonoDroid] at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPageInternal (Xamarin.Forms.Page newRoot) [0x00067] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:339 [MonoDroid] at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x000e6] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:291 [MonoDroid] at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x00039] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:515 [MonoDroid] at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.SetMainPage () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:541 [MonoDroid] at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.LoadApplication (Xamarin.Forms.Application application) [0x00140] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:191 [MonoDroid] at PrismTabNav.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x0002f] in /Users/dylanberry/Projects/PrismTabNav/PrismTabNav.Android/MainActivity.cs:32 [MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <4ccdb3137d974856b786e1aeebbfbab6>:0 [MonoDroid] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.8(intptr,intptr,intptr)
- same scenario as above, but with dynamically created tabs (https://tomobiledevs.com/TabbedPage?createTab=AboutPage&createTab=ItemsPage&selectedTab=ItemsPage/ItemDetailPage?Id=2)
- Url parsing within
PageNavigationService
does not account for a pipe being present within theselectedTab
paramater and fails to selected a tab and do any further navigation (https://tomobiledevs.com/TabbedPage?createTab=AboutPage&createTab=NavigationPage|ItemsPage&selectedTab=ItemsPage|ItemDetailPage?Id=2) - ame scenario as above, but with statically created tabs (https://tomobiledevs.com/MainPage?selectedTab=ItemsPage|ItemDetailPage?Id=2)
-
Navigation logic:
- slash indicates a new navigation segment not a continuation of the existing segment - ie. opens a modal page with a new navigation stack
- To create a tab that wraps a page in a NavigationPage, simply denote this as a nested hierarchy using the | character. TabbedPage?createTab=NavigationPage|ViewA
-
Navigation Scenarios:
- Relative url + Modal (ViewC): TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC
- Absolute url + Modal (ViewC): /TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC
- Where are the unit tests? Are there docs for the tests and different solution files? If not, I can create some.
- What is PageNavigationService.RemovePageSegment?
- How do we want to structure navigation segments/delimeters? https://tomobiledevs.com/TabbedPage?createTab=AboutPage&createTab=NavigationPage|ItemsPage&selectedTab=ItemsPage|ItemDetailPage?Id=2
- Write tests (unit and UI) for our scenarios
- Implement parsing for pipe delimeter within
selectedTab
navigation parameter/url query param
- Private/secrets scene