Пример #1
0
        static void RightButtonDownShow(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var element      = (UIElement)sender;
            var targetWindow = element.GetValue(TargetWindow) as Window;
            var showMenuAt   = targetWindow.PointToScreen(Mouse.GetPosition((targetWindow)));

            SystemMenuManager.ShowMenu(targetWindow, showMenuAt);
        }
Пример #2
0
        static void LeftButtonDownShow(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (leftButtonToggle)
            {
                var element      = ((UIElement)sender).GetValue(LeftButtonShowAt);
                var showMenuAt   = ((Visual)element).PointToScreen(new Point(0, 0));
                var targetWindow = ((UIElement)sender).GetValue(TargetWindow) as Window;

                SystemMenuManager.ShowMenu(targetWindow, showMenuAt);

                leftButtonToggle = !leftButtonToggle;
            }
            else
            {
                leftButtonToggle = !leftButtonToggle;
            }
        }