Ejemplo n.º 1
0
 static void EnableWindow(WindowContainer container, SplashScreenLock lockMode)
 {
     if (lockMode == SplashScreenLock.Full)
     {
         SplashScreenHelper.SetWindowEnabled(container.Handle, true);
     }
     else
     {
         UIElement visual = lockMode == SplashScreenLock.InputOnly ? container.Window : container.WindowObject as UIElement;
         if (visual != null)
         {
             visual.SetCurrentValue(UIElement.IsHitTestVisibleProperty, true);
             visual.PreviewKeyDown -= OnWindowKeyDown;
         }
     }
 }
 static void EnableWindow(WindowContainer container, WindowLockInfo lockInfo)
 {
     if (lockInfo.LockMode == SplashScreenLock.Full)
     {
         SplashScreenHelper.SetWindowEnabled(container.Handle, true);
     }
     else if (lockInfo.LockMode == SplashScreenLock.InputOnly)
     {
         container.Window.IsHitTestVisible = lockInfo.IsHitTestVisible;
         container.Window.PreviewKeyDown  -= OnWindowKeyDown;
     }
     else if (lockInfo.LockMode == SplashScreenLock.LoadingContent)
     {
         FrameworkElement content = container.WindowObject as FrameworkElement;
         if (content != null)
         {
             content.PreviewKeyDown  -= OnWindowKeyDown;
             content.IsHitTestVisible = lockInfo.IsHitTestVisible;
         }
     }
 }
Ejemplo n.º 3
0
        static void EnableWindow(WindowContainer container, ContainerLockInfo lockInfo)
        {
            switch (lockInfo.LockMode)
            {
            case SplashScreenLock.InputOnly:
                container.Window.IsHitTestVisible = lockInfo.IsHitTestVisible;
                container.Window.PreviewKeyDown  -= OnWindowKeyDown;
                break;

            case SplashScreenLock.Full:
                SplashScreenHelper.SetWindowEnabled(container.Handle, true);
                break;

            case SplashScreenLock.LoadingContent:
                FrameworkElement content = container.WindowObject as FrameworkElement;
                if (content != null)
                {
                    content.PreviewKeyDown  -= OnWindowKeyDown;
                    content.IsHitTestVisible = lockInfo.IsHitTestVisible;
                }
                break;
            }
        }