question

Oregon39-5606 avatar image
0 Votes"
Oregon39-5606 asked Oregon39-5606 commented

Nav Drawer Menu and Map

We have a map page (using custom renderers for iOS, UWP, and Android) that has a listview on the left side of the page. There is a toggle button that makes the map open to full screen mode (hiding the listview). When I swipe right on the map the nav drawer opens instead of moving the map. Is there a way to give priority to the map gesture over the navigation drawer so the map can be moved without activating the sliding nav drawer menu?

dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

When I swipe right on the map the nav drawer opens instead of moving the map

Hi, Oregon39. Do you use some tempalte for the application? Could you please post some details about the page?

Is there a way to give priority to the map gesture over the navigation drawer so the map can be moved without activating the sliding nav drawer menu?

How did you make the map to be opened in full screen mode? If you want to avoid the above problems, you could try to navigate to a new page to display the map.

0 Votes 0 ·

Hi Jarvan, There's a custom map with three different listviews that are shown or hidden by clicking a tab.
The Nav Drawer is part of a master class.

                 <customRenderers:CustomMap Grid.Column="1"   x:Name="CustomMap" 
                                            WidthRequest="1600" 
                                            HeightRequest="1600"
                                            IsVisible="true"
                                            ZoomPosition="{Binding ZoomPosition, Mode=TwoWay}"
                                            MapType="{Binding MapTypeValue}"
                                            NavigationService="{Binding NavService}"
                                            CustomPins="{Binding CustomPins,Mode=TwoWay}"/>
0 Votes 0 ·

Attached is the map class
100368-mapclass.txt


0 Votes 0 ·
mapclass.txt (27.5 KiB)

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered Oregon39-5606 commented

Hello,​

Welcome to our Microsoft Q&A platform!

When I swipe right on the map the nav drawer opens instead of moving the map

Sorry, I cannot reproduce the issue on my side because there are some custom controls. What does the 'nav drawer' mean? The toolbar item? It doesn't provide the swipe gesture. Accoding to the code, some view binds with the same command which may cause the issue.

You could try to use the Shell template to dispaly the views, it's not a good idea to create too much logical views in the same page.

Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JarvanZhang-MSFT
Thanks for your response. Sorry for the delay. I was on vacation from work last week. The 'nav drawer' is just the hamburger menu item to open the menu. You can open it on all the pages by either clicking it or by swiping right on the page. But in this case, on the map page, it somewhat interferes with moving the map.

0 Votes 0 ·

@JarvanZhang-MSFT The app is using Prism and a Master Page to implement the hamburger/sliding menu.

0 Votes 0 ·

@JarvanZhang-MSFT Actually, at the top of the Map Page, there is no hamburger menu, just a back button to the previous page. So I'm getting the sliding menu from the Master Page, despite there being no menu icon. What I'd like is to disable that sliding menu for the map page.

0 Votes 0 ·

I try to simplify the code to reproduce the issue, but failed to do that. Is there any swipe event in the page? Try to add beakpoint to check which event is triggered when swiping the map.

0 Votes 0 ·

@JarvanZhang-MSFT The app is using a Prism MasterDetail Page for the sliding menu.
https://prismlibrary.com/docs/xamarin-forms/navigation/working-with-masterdetailpages.html
I'm trying to find a way to just keep the navigation as it is using relative navigation (maintaining the navigation stack) but disable the master-detail functionality for the map page.

I tried this solution but I can't access the static method in a non-static context: https://stackoverflow.com/questions/56853215/how-to-navigate-from-a-normal-page-to-a-masterdetailpage-using-prism-forms-frame
I've also been looking at this post:
https://forums.xamarin.com/discussion/103038/masterdetail-page-how-to-only-work-in-main-page

0 Votes 0 ·
Show more comments