bypass tab click in tabbed page - xamarin.forms

My application is using a tabbed page to separate 2 main areas. Using Xamarin.Forms 4.x and Prism.
The first tab basically hosts a set of linear navigated views modelling a workflow. It's been identified that when a user has progressed through the workflow, and accidentally taps on the current tab, the user is popped back to the start of the navigation.
Is there any way to bypass this event?
This only seems to happen on iOS.

I just discovered the answer. Works perfectly.
https://forums.xamarin.com/discussion/144478/ios-stop-tab-re-select-pop-to-navigation-page-root

Related

How do I change the content shown in the master section of a master detail page using Prism

I'm migrating our app from MvvmCross as we need to add Intune support and using MVX is preventing this.
The app is essentially an email reader, so currently we are using a MasterDetail page and loading a folder list into master which on phones becomes the flyout and on tablets this appears in the left of the split view.
When you select a folder from this page we then show a message list - this loads into the detail on phone, but for tablets we use MVX functionality to load this into master, this is also wrapped inside a nav page so you can go back to the folder list. Essentially we have a nav stack inside the master section on tablets and also one in the detail section.
I've checked and played around with the Prism samples, but they don't appear to cover this scenario. The documentation recommends only having fixed content in the master section and this is bound to the master detail view model. This is different to what we have currently, essentially we can control where any page ends up depending on idiom.
I would just like confirmation that it is possible for me to be able to load a page into detail or master depending on the device idiom and any examples would be greatly appreciated!
The Master property of the MasterDetailPage is a basic Page object so it does not have a navigation stack available but the property itself does have a getter and a setter so you should be able to set the page manually. We use a master page and as a quick test I was able to set it using:
((MasterDetailPage)Application.Current.MainPage).Master = new SwapMaster();
What might be possible that I didn't try is actually set the Master as a NavigationPage. Then you might be able to push onto the Master's navigation stack. Again, I did not try this ATM.
Update:
So I did play around quickly with setting the Master to a navigation page and then pushing and popping pages on and off the stack. It did work but the behavior was a little squirrelly but it does show it might be possible.
Push on the stack:
((NavigationPage)Master).Navigation.PushAsync(new SwapMasterPage());
Pop the stack:
((NavigationPage)((MasterDetailPage)Application.Current.MainPage).Master).Navigation.PopAsync();
I've answered this myself by taking a look in the source and there is no support in the Prism navigation service to load a page into master. Everything is overridable, but I feel it would result in lots of changes and issues if I try and introduce this concept.
We'll have to discuss internally if changing the UI flow on tablets is acceptable, if not then Prism is a no go and we'll look at alternatives or write our own navigation service to support it.

Prism detecting if page is modal programmatically and go back

I am implementing a feature using "connectivity" from essentials that when the app goes "offline" no wifi etc.. it navigates to a specific page.
It works in most cases however if I set the phone on "Airplane Mode" when I am on a modal page it does not navigate to my page.
In Prism is there a way to detect if the current page "IsModal" and either goback or kill it so that I can navigate to my specific Page?
THanks
You'd have to write some crazy lookup logic to figure it out. Unfortunately the helper for that doesn't currently exist. However the latest Prism 7.2 preview has some enhancements that specifically attempt to eliminate the need to figure out whether you require Modal Navigation and automatically use the proper type of Navigation. I would encourage you to try the preview. If you come up with a scenario where GoBack isn't working correctly please open an issue.

Visual response for loading pages in pwa

Is there a way to let PWA users know that a clicked link is being loaded. Usually in the browser we see the blue progress line indicating this but in the pwa the user is left to assume the page is loading except there is a pseudo effect on the buttons programmed by the developer. I understand the idea behind pwa includes giving users immersive visuals and if pages load faster, the users will not bother about the blue line but sometimes it's needed.
Going through the same thing but i think i found a way.
We can use bootstrap spinners to animate this. We can use javascript to detect a link click and show the spinner. We can also add this on submit button click.

How to add back navigation functionality to standard SAPUI5 application 'ar_srvc_news'?

I have configured a news tile in Fiori Launchpad and linked the ar_srvc_news (found in the SPBUTIL role in lpd_cust) UI5 application to it. Is there a way to enable back navigation functionality in it similar to the one that exists in SAP Fiori Trial website (highlighted in below image)?
The tile configured in our system opens the News application without any header. I checked the BSP application AR_SRVC_NEWS in SE80 and the view that displays these news items is NewsTileDrillDown.view.js. The navigation button that allows back navigation has not been enabled in it. I assume we set the showNavButton for sap.m.Page to be true to enable this functionality. Feel free to correct me if this is not correct.
Also, a blank window opens up upon clicking on any of the news items. The application is displaying sap.suite.ui.commons.FeedItemHeader for displaying the news items. How to disable this navigation? I observed that in SAP Fiori Trial website, only the last news item is clickable and opens a new window. We are following the same RSS feed hierarchy as the website's but this does not help.

MasterDetail and NavigationPage deeplinking in Prism Forms

I am testing the deeplinking feature of the Prism Forms framework. I currently have a situation where I have a MasterDetailPage with a menu as Master. When I click the menu items, the Details should change to specific pages with a clean NavigationPage as container.
When I check the Sandbox example for Prism Forms, it shows an example for MasterDetail navigation, but not including navigation pages.
So I have this (absolute) deeplink structure at startup: /MasterDetailPage/NavigationPage/MyFirstPage
Then I want the second menu item to link to a fresh NavigationPage:
/MasterDetailPage/NavigationPage/MySecondPage
My current workaround is to do absolute deeplinking, but I was wondering if there is a better way? The Prism PageNavigationService checks to see if the segment type is the same as the current detail type. But since these are both NavigationPages, it tries to add the new page in the already existing NavigationPage. At that moment it also kills the menu-icon (at least on iOS).
Actually, the Sandbox app does use NavigationPages in the MasterDetail: https://github.com/PrismLibrary/Prism/blob/master/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml
Prism reuses the detail page for performance reasons, but it doesn't work like you think it does. While it does add the new page to the NavigationPage's NavigationStack, it also removes the previous page from the stack. This keeps the NavigationStack in the proper state.
The icon behavior you are seeing is because of a confirmed bug in Xamarin.Forms. You can follow the issue here: https://bugzilla.xamarin.com/show_bug.cgi?id=41038
As soon as Xamarin fixes this bug, I will publish the fix to Nuget. In the mean time, the only way to get around this is to fork the Prism code base and remove the Page type check.

Resources