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

Navigation Drawer Toggled event: different behaviour from iOS and Android

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?

5 Replies

PA Paul Anderson S Syncfusion Team 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 



MC Matteo Comi 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


PA Paul Anderson S Syncfusion Team 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 



MC Matteo Comi December 13, 2018 08:22 AM UTC

Hello,
thank you very much.


PA Paul Anderson S Syncfusion Team December 13, 2018 09:22 AM UTC

Hi Matteo, 
  
You are welcome. 
  
Regards, 
Paul Anderson 


Loader.
Live Chat Icon For mobile
Up arrow icon