예제 #1
0
        void PaneContent_ManipulationDelta(object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
        {
            DebugWrite($"OpenCloseMode {OpenCloseMode}");

            if (OpenCloseMode.HasFlag(OpenCloseModes.None))
            {
                return;
            }
            else if (OpenCloseMode.HasFlag(OpenCloseModes.Auto))
            {
                // this is only for touch
                switch (e.PointerDeviceType)
                {
                case Windows.Devices.Input.PointerDeviceType.Pen:
                case Windows.Devices.Input.PointerDeviceType.Mouse:
                    return;
                }
            }
            else if (!OpenCloseMode.HasFlag(OpenCloseModes.Swipe))
            {
                return;
            }

            var threshold = 24;
            var delta     = e.Cumulative.Translation.X;

            if (delta < -threshold)
            {
                IsOpen = false;
            }
            else if (delta > threshold)
            {
                IsOpen = true;
            }
        }
예제 #2
0
        void PaneContent_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            DebugWrite($"OpenCloseMode {OpenCloseMode}");

            if (OpenCloseMode.HasFlag(OpenCloseModes.None))
            {
                return;
            }
            else if (OpenCloseMode.HasFlag(OpenCloseModes.Auto))
            {
                switch (e.PointerDeviceType)
                {
                case Windows.Devices.Input.PointerDeviceType.Touch:
                    return;
                }
            }
            else if (OpenCloseMode.HasFlag(OpenCloseModes.Tap))
            {
                return;
            }
            HamburgerCommand.Execute(null);
        }