I'm using SwipeView in my project to show and hide the side menu on left of the page. Now I want to to open and hide the menu by tapping on button and not by sliding the page. So far I figure out how to open and hide the menu even by tapping on button but I didn't find solution to how I'm disabling the sliding that open the menu.
Any idea how can I do it in the right way?
Here is my code for achieving the sliding and tapping effect.
This is the Code in xaml.cs:
private async void OpenAnimation()
{
await swipeContent.ScaleYTo(0.9, 300, Easing.SinOut);
}
private async void CloseAnimation()
{
await swipeContent.RotateTo(0, 300, Easing.SinOut);
}
private void OpenSwipe(object sender, EventArgs e)
{
MainSwipeView.Open(OpenSwipeItem.LeftItems);
OpenAnimation();
}
private void CloseSwipe(object sender, EventArgs e)
{
MainSwipeView.Close();
CloseAnimation();
}
private void SwipeStarted(object sender, SwipeStartedEventArgs e)
{
OpenAnimation();
}
private void SwipeEnded(object sender, SwipeEndedEventArgs e)
{
if (!e.IsOpen)
CloseAnimation();
}
This is the Code in xaml
<SwipeView x:Name="MainSwipeView" BackgroundColor="Transparent"
SwipeStarted="SwipeStarted" SwipeEnded="SwipeEnded">
Thanks.