NativeScript BottomNavigation -> how to open default page on bottom navigation item tap? - nativescript

I have page called "Fund". I have bottom navigation with 5 tabs - "Home" / "Portfolio" and 3 others. In default behaviour all tabs has it's own navigation stack and if opened "Fund" in Home and then opened Portfolio when i return to Home "Fund" still be opened.
My goal is open default page for opened bottom navigation tab on every touch.
Here is the sample code {N} Playground

Solved in this issue
It's quite possible Frame.topmost() gets confused during tab
transition. However, you can access a certain tab frame and call
goBack() for it. Check this playground and let me know if it solves
your problem:
https://play.nativescript.org/?template=play-tsc&id=4Ij5yz&v=7

Related

Xamarin Master Detail prism Nav bar back button

I have a masterdetailview that uses prism. When I click on one of the menu items the hamburger menu shows up on the nav bar of the new page I clicked and I really just want the top nav bar to show a back button and be able to go back. How can I achieve this ?
When my app loads I call
await NavigationService.NavigateAsync("/MainPage/NavigationPage");
I figured I could call
await NavigationService.NavigateAsync("/MainPage/NavigationPage/InviteFriends");
and this would provide the newpage with a back button to Home but when I do this it doesn't do anything
EDIT
if I change to
await NavigationService.NavigateAsync("/MainPage/NavigationPage/FeaturePage");
which is what the home page will be called(Feature Page) it will not load the page at all.
MainPage is my list of other pages to go to that is shown when the hamburger is pressed if that helps. Feature page is the page I would want to show below the hamburger page and be the "Home" screen.
am I doing that correctly ?
So if we take your example you have the following Navigation Stack:
MainPage/NavigationPage
Let's assume your navigation code looks like this in the Master-Detail View Model
await NavigationService.NavigateAsync("/MainPage/NavigationPage/InviteFriends");
This will lead to the following Navigation Stack:
/MainPage/NavigationPage/InviteFriends
This is because the navigation was called from the master-detail page.
The master-detail page is considered a root page in Prism and when navigating from a Master-detail page it will set the target page as the detail page of the master-detail.
Check out this article for a more detailed breakdown Link
Be careful - Starting with /MainPage will clear the Navigation stack
One quick solution to this is to add your homepage to the navigation call:
await NavigationService.NavigateAsync("MainPage/NavigationPage/HomePage/InviteFriends");
This will create the following:
MasterDetailPage/NavigationPage/HomePage/InviteFriends
This should hopefully create the response you are looking for.
Hope this helped. Happy coding!
EDIT:
I think if you separate your initial Detail Page out into its own file you should then be able to do the following:
await NavigationService.NavigateAsync("MainPage/NavigationPage/HomePage/InviteFriends");

how to navigate from a content page to the second tab of Tabbed page in xamarin.forms using Prism

once user click on the search bar he/she directs to a model content page and after searching and selecting the search result. I want user to redirect to the second tab of a tabbed page.
is this possible using prism ?
Navigation for TabbedPages has been improved with Prism 7. Please see the blog post here
NavigateAsync(“TabbedPage?selectedTab=MiddleTab/ViewA/ViewB”)
This will navigate to the TabbedPage, selected the MiddleTab and continue navigating ViewA and ViewB onto the navigation stack.
The blog post ist not 100% clear, but don't take MiddleTab literally. Most likely this will be the class name of a view added to the TabbedPage.

xamarin - apply consistent navigation across all content page

I am developing an APP using Xamarin, i trying to apply an consistent navigation system for my app.
I have used xamarin master detail navigation and binded the master page with few details page through ObservableCollection list.
My default details page is again a tabbled page. Within Tabled page on click of some button i need open some content page which are not part of master page.
What i want is- any conent page should open within the master page means from any content page master page's header and left sliding menu should be easily available to user.
I am tryng to bind master page from content page on runtime but no luck yet. Please help.
====updating my query for better understanding===
1. Sample master details page look like below
[1
Click on item 1 open page 1 with sliding icon on left side of page title
Click on "GO TO PAGE 3" open page 3 with navigation back button. I think as this page is not bind to master page it shows normal back button. Basically i want to replace this navigation back button with "master detail" sliding button in every page those are not part of master page.
Please let me know how to replace navigation back button icon and behavior with master detail sliding button. I know following line of code can be used to open sliding menu but do not know how to hook the back button even.
(App.Current.MainPage as MasterDetailPage).IsPresented = true;

Gantry Framework is hiding the wrong menu on mobile in Joomla 3.7. How do i get it to hide the correct one?

The site I'm working on has its main menu in the "Navigation" section in gantry. I have another 2 menus on the page (in the "header" area), though they don't actually link anywhere. They exist as "text separators" that show a module in the dropdown box that shows when the "link" is hovered over (so one is a spyglass that shows the search module in the dropdown).
When i shrink the screen size, gantry eventually causes the menu to disappear an then enables the mobile menu, accessed by the burger button.
The problem is, instead of hiding the actual main menu in the navigation section, it's hiding the first "fake" menu search button in the header section.
I can't see anywhere to set which menu is the one that should be hidden. How do i do this?
Been stuck on this since yesterday. Finally caved and post about it on this site then find the answer 20 minutes later, naturally.
I needed to check the box marked "Mobile Target" on the menu i want to be the one to be hidden. I thought this did something else so never tried using it but it seems so obvious now.

firefox addons panel hide

My addon opens a popup panel (popup.html).
When the user changes the current tab to different tab, the popup panel is hidden
When the tab is selected second time I need it to still available contentURL (popup.html) but I did find the way to do it.
You can create your panel like this:
<panel
id="yourPanel"
type="arrow"
noautohide="true"
level="parent">
</panel>
Explanation:
level = "parent" means the panel is shown just above the window the panel is in, but behind other windows above it.
noautohide = "true" means the panel will only be closed when the hidePopup method is called.
With these two combined, you get the behavior you're looking for.
For reference see mdn panel page

Resources