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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Navigation Drawer Toggled event: different behaviour from iOS and Android

Thread ID:

Created:

Updated:

Platform:

Replies:

141452 Dec 12,2018 10:02 AM UTC Dec 13,2018 09:22 AM UTC Xamarin.Forms 5
loading
Tags: SfNavigationDrawer
Matteo Comi
Asked On December 12, 2018 10:02 AM UTC

Hello,
I have a SfNavigationDrawer control with a secondary drawer, and I created a method for the Toggled event:

<navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" IsOpen="{Binding IsOpen, Mode=TwoWay}" Toggled="NavigationDrawer_Toggled">
...
<navigationdrawer:SfNavigationDrawer.SecondaryDrawerSettings>
<navigationdrawer:DrawerSettings x:Name="secondaryDrawer" IsOpen="{Binding IsOpenSecondary, Mode=TwoWay}">
...
</navigationdrawer:DrawerSettings>
</navigationdrawer:SfNavigationDrawer.SecondaryDrawerSettings>
</navigationdrawer:SfNavigationDrawer>

In this method I'd like to test if it is the secondary drawer which has been toggled, and if it is closing perform an action:

private async void NavigationDrawer_Toggled(object sender, Syncfusion.SfNavigationDrawer.XForms.ToggledEventArgs e)
{
if (e != null)
{
bool drawerState = e.isOpen;
if (e.IsSecondaryDrawer)
{
if (!drawerState)
await Modello.ReloadData();
}
}
}

What I want the method to do is the perform the action when the secondary drawer is closing. In Android the method acts as expected, while in iOS it doesn't.
Is there a way to achieve my goal? Am I doing something wrong?

Paul Anderson S [Syncfusion]
Replied On December 12, 2018 11:59 AM UTC

Hi Matteo, 
 
Greetings from Syncfusion. 
 
Query: “In Toggle event, perform the action when the secondary drawer is closing not working in iOS” 
 
We have analyzed the reported query and we are able to reproduce the reported issue in iOS platform. We have logged a bug report for and you can keep track of the bug from the feedback portal below.  
 
 
 
The fix will be available in our upcoming Volume 4 SP 1 release which is scheduled to be rolled out at end of January 2019. Would waiting for the official release work for you? Otherwise, we can provide a patch if you can create a direct track support incident.   
 
You can achieve your requirement by using Closing event and add your method when secondary drawer is closing. We have created a sample by using a Closing event. Please have the sample from the following link 
 
 
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal link above.  
 
Thanks,  
Paul Anderson 


Matteo Comi
Replied On December 12, 2018 02:26 PM UTC

Hi Paul,
thanks for your feedback.
I think I will wait for the fix. According to your code, the same issue is occurring also in UWP platform (isOpen is always false). Can you please check?

In the meantime I tried the following code but the closing event is getting called also when the drawer is opening:

 private async void NavigationDrawer_Toggled(object sender, Syncfusion.SfNavigationDrawer.XForms.ToggledEventArgs e)
{
if (e != null)
{
bool drawerState = e.isOpen;
if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.UWP)
{
if (e.IsSecondaryDrawer)
{
if (!drawerState)
await Modello.ReloadData();
}
}
}
}

private async void NavigationDrawer_Closing(object sender, CancelEventArgs e)
{
if (Device.RuntimePlatform == Device.iOS)
{
if (e.IsSecondaryDrawer)
{
await Modello.ReloadData();
}
}
}

Any suggestions?

EDIT: I created an incident in Direct-Trac

Paul Anderson S [Syncfusion]
Replied On December 13, 2018 06:39 AM UTC

Hi Matteo, 
  
Thanks for the update. 
  
We have checked the reported issue with SfNavigationDrawer and we will share you the details in the support incident you have created. Please have further followup with that incident. 
  
Regards, 
Paul Anderson 


Matteo Comi
Replied On December 13, 2018 08:22 AM UTC

Hello,
thank you very much.

Paul Anderson S [Syncfusion]
Replied On December 13, 2018 09:22 AM UTC

Hi Matteo, 
  
You are welcome. 
  
Regards, 
Paul Anderson 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;