We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Avoid down gesture to close navigationDrawer

Hello SyncfusionTeam,

I implemented a navigation drawer and binded its property IsOpen to a property in my ViewModel that changes from inside commands.

However, I want the navigation drawer to close and open ONLY from these commands and not user input.

I noticed in the output that when a user clicks outside the navigation drawer content the event "Down" is called and so closes the navigationDrawer. 

I/mono-stdout(12639): Down Called

Prob is that my VM's property is not aware of these changes from within this event.

 Is it possible to remove/avoid this behavior ?

Best regards,

3 Replies

PA Paul Anderson S Syncfusion Team December 7, 2018 09:04 AM UTC

Hi Rjuken, 
 
Greetings from Syncfusion. 
 
Query: “I want the navigation drawer to close and open ONLY from these commands and not user input” 
 
You have achieve your requirement by using a Closing Event and set e.cancel as true . when set the e.cancel as true in the Closing event means it drawer doesn’t close. 
 
We have prepared a sample by using a Closing event and the drawer is not closed until the IsOpen property is set as false. Please check the sample from the following link  
 
 
Please let us know the reported query is resolved from your side.  
 
Regards, 
Paul Anderson 



RD Rjuken Developments December 9, 2018 10:36 PM UTC

Hello SyncfusionTeam,

Thank  you for your answer. That works, even if its a bit "dirty hacky". I think that could be a good idea to expose a boolean property on the navigationDrawer for this purpose. 

NB : you forgot to add the "Closing="NavigationDrawer_Closing"" to the navigationDrawer in your sample :). 

Best regards


PA Paul Anderson S Syncfusion Team December 10, 2018 11:57 AM UTC

 
Hi Rjuken, 
 
Thanks for your update. 
 
Query1: I think that could be a good idea to expose a boolean property on the navigationDrawer for this purpose. 
  
We have considered your request for having a Boolean property for handling the closing of events only through code as a feature and added to our feature list. This will be available in any one of our upcoming release. 
 
Please visit our website periodically for feature updates. 
 
Query2: you forgot to add the "Closing="NavigationDrawer_Closing"" to the navigationDrawer in your sample :). 
 
We have added the event in the code behind in the provided sample. 
 
Regards, 
Paul Anderson 


Loader.
Live Chat Icon For mobile
Up arrow icon