Ejemplo n.º 1
0
        private void AppBarEvent(object sender, AppBarEventArgs e)
        {
            if (Settings.Instance.TaskbarMode == 2)
            {
                if (sender is MenuBar menuBar)
                {
                    var taskbar = (Taskbar)WindowManager.GetScreenWindow(Windows, menuBar.Screen);

                    if (taskbar == null)
                    {
                        return;
                    }

                    if (taskbar.AppBarEdge != menuBar.AppBarEdge)
                    {
                        return;
                    }

                    if (e.Reason == AppBarEventReason.MouseEnter)
                    {
                        taskbar.CanAutoHide = false;
                    }
                    else if (e.Reason == AppBarEventReason.MouseLeave)
                    {
                        taskbar.CanAutoHide = true;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        void OnAppBarEvent(object sender, AppBarEventArgs e)
        {
            Thread.Sleep(10);
            Debug.Print("OnAppBarEvent, Action: {0}, Data: {1}", e.Action, e.Data);

            switch (e.Action)
            {
            case AppBarNotificationAction.ErrorEvent:
                Log.Warn(e.Data);
                break;

            case AppBarNotificationAction.ShowWindow:
                ShowWindow();
                break;

            case AppBarNotificationAction.HideWindow:
                HideWindow();
                break;

            case AppBarNotificationAction.PositionChanged:
            case AppBarNotificationAction.StateChanged:
                Log.Debug("PositionChanged/StateChanged");
                HideWindow();
                ShowWindow();
                break;

            case AppBarNotificationAction.FullScreenApp:
                OnFullScreenWindowChanged((bool)e.Data);
                break;
            }
        }