-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml.cs
53 lines (43 loc) · 1.37 KB
/
MainPage.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Plugin.SharedTransitions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace WatchWall
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void OpenMenu()
{
MenuGrid.IsVisible = true;
Action<double> callback = input => MenuView.TranslationX = input;
MenuView.Animate("anim", callback, -260, 0, 16, 300, Easing.CubicInOut);
}
private void CloseMenu()
{
Action<double> callback = input => MenuView.TranslationX = input;
MenuView.Animate("anim", callback, 0 , -260, 16, 300, Easing.CubicInOut);
MenuGrid.IsVisible = false;
}
private void MenuTapped(object sender, EventArgs e)
{
OpenMenu();
}
private void OverlayTapped(object sender, EventArgs e)
{
CloseMenu();
}
private void ProductSelected(object sender, SelectionChangedEventArgs e)
{
SharedTransitionNavigationPage.SetTransitionSelectedGroup(this, vm.SelectedProduct.Name);
vm.ShowDetails();
}
}
}