Beispiel #1
0
        protected override void FocusContent()
        {
            if (!(IsActiveContent && !IsKeyboardFocusWithin))
            {
                return;
            }
            IInputElement activeChild = CustomFocusManager.GetFocusedChild(this);

            AvalonWorkbenchWindow.SetFocus(this, () => activeChild ?? (padInstance != null ? padInstance.InitiallyFocusedControl as IInputElement : null));
        }
Beispiel #2
0
        public IWorkbenchWindow ShowView(IViewContent content, bool switchToOpenedView)
        {
            AvalonWorkbenchWindow window = new AvalonWorkbenchWindow(this);

            workbenchWindows.Add(window);
            window.ViewContents.Add(content);
            window.ViewContents.AddRange(content.SecondaryViewContents);
            window.Show(dockingManager);
            if (switchToOpenedView)
            {
                window.Activate();
            }
            window.Closed += window_Closed;
            return(window);
        }
        protected override void FocusContent()
        {
            WpfWorkbench.FocusDebug("{0}.FocusContent() IsActiveContent={1} IsKeyboardFocusWithin={2} Keyboard.FocusedElement={3}",
                                    Title, IsActiveContent, IsKeyboardFocusWithin, Keyboard.FocusedElement);
            if (!(IsActiveContent && !IsKeyboardFocusWithin))
            {
                return;
            }
            IInputElement activeChild = CustomFocusManager.GetFocusedChild(this);

            WpfWorkbench.FocusDebug("{0}.FocusContent() - Will move focus (activeChild={1})", this.Title, activeChild);
            // use lambda for fetching the active child - this is necessary because the ActiveViewContent might change until the background
            // action is called
            AvalonWorkbenchWindow.SetFocus(this, () => activeChild ?? (ActiveViewContent != null ? ActiveViewContent.InitiallyFocusedControl as IInputElement : null));
        }
Beispiel #4
0
        void OnExecuteRoutedCommand(object sender, ExecutedRoutedEventArgs e)
        {
            workbench.VerifyAccess();
            RoutedCommand         routedCommand   = e.Command as RoutedCommand;
            AvalonWorkbenchWindow workbenchWindow = ActiveWorkbenchWindow as AvalonWorkbenchWindow;

            if (!e.Handled && routedCommand != null && workbenchWindow != null && !isInNestedExecute)
            {
                IInputElement target = workbenchWindow.GetCommandTarget();
                if (target != null && target != e.OriginalSource)
                {
                    isInNestedExecute = true;
                    try {
                        routedCommand.Execute(e.Parameter, target);
                    } finally {
                        isInNestedExecute = false;
                    }
                    e.Handled = true;
                }
            }
        }
 public TabControlWithModifiedShortcuts(AvalonWorkbenchWindow parentWindow)
 {
     this.parentWindow = parentWindow;
 }
 internal ViewContentCollection(AvalonWorkbenchWindow window)
 {
     this.window = window;
 }