ToolWindow hang

Docking/MDI for WPF Forum

Posted 14 years ago by Jim Strav
Version: 9.2.0510
Platform: .NET 3.5
Environment: Windows XP (32-bit)
Avatar
When I close my ToolWindows via the UI or programmatically, my app hangs and CPU gets pinned at 100%. The last call I see in the call stack before it gets stuck in the Presentation framework is:

ActiproSoftware.Windows.Controls.Docking.DockSite.ActivatePrimaryDocument

I am using nested dock sites as follows:

            <docking:DockSite
                          AreDocumentWindowsDestroyedOnClose="True"
                          AllowDrop="True">
                <docking:SplitContainer Orientation="Horizontal" >
                    <docking:ToolWindowContainer />

                    <docking:Workspace>
                        <docking:TabbedMdiHost                                          AreDocumentDropDownButtonsVisible="True" 
                                               IsCloseButtonOnTab="True">
                            <docking:TabbedMdiContainer />
                        </docking:TabbedMdiHost>
                    </docking:Workspace>
                </docking:SplitContainer>

            </docking:DesignerDockSite>
Then I add a DocumentWindow via:

myWindow.TabbedMDIContainer.Items.Add(documentWindow);                
My custom document window has another dock site in a grid as follows:

   <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Frame Grid.Row="0"/>

        <docking:DockSite x:Name="documentDockSite"
                                Grid.Row="1"
                                UseHostedRaftingWindows="True"
                                InactiveRaftingWindowFadeDelay="00:00:00" 
                                InactiveRaftingWindowFadeDuration="00:00:01"
                                InactiveRaftingWindowFadeOpacity="0.50"
                                WindowClosing="DesignerControlDockSite_WindowClosing" 
                                WindowClosed="DesignerControlDockSite_WindowClosed"
                                WindowDragged="DesignerControlDockSite_WindowDragged">
            <docking:SplitContainer>
                <docking:ToolWindowContainer x:Name="ToolWindowContainer"/>
                <docking:Workspace x:Name="Workspace" AllowDrop="True">
                    <Grid x:Name="WorkspaceGrid" />
                </docking:Workspace>
            </docking:SplitContainer>
        </local:DesignerDockSite>
    </Grid>
Finally, I simply construct a ToolWindow as follows:

ToolWindow t = new ToolWindow(documentDockSite, "myTool", "My Tool", null, myUserControlContent);
Here is the full call stack from the Close "X" button press:

PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.GetTabIndexHelper(System.Windows.DependencyObject d) + 0x22 bytes    
     PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.GetFirstTabInGroup(System.Windows.DependencyObject container = {ActiproSoftware.Windows.Controls.Docking.Workspace}) + 0x4d bytes    
     PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.GetNextTabInGroup(System.Windows.DependencyObject e, System.Windows.DependencyObject container, System.Windows.Input.KeyboardNavigationMode tabbingType) + 0x28 bytes    
     PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.GetNextTab(System.Windows.DependencyObject e, System.Windows.DependencyObject container = {ActiproSoftware.Windows.Controls.Docking.Workspace}, bool goDownOnly = true) + 0xf8 bytes    
     PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.Navigate(System.Windows.DependencyObject currentElement = {ActiproSoftware.Windows.Controls.Docking.Workspace}, System.Windows.Input.TraversalRequest request = {System.Windows.Input.TraversalRequest}, System.Windows.Input.ModifierKeys modifierKeys = None, System.Windows.DependencyObject firstElement = null) + 0x12c bytes    
     PresentationFramework.dll!System.Windows.FrameworkElement.MoveFocus(System.Windows.Input.TraversalRequest request) + 0x2e bytes    
     ActiproSoftware.Docking.Wpf30.dll!ActiproSoftware.Windows.Controls.Docking.DockSite.ActivatePrimaryDocument() + 0xf9 bytes    
     ActiproSoftware.Docking.Wpf30.dll!ActiproSoftware.Windows.Controls.Docking.DockSite.a(ActiproSoftware.Windows.Controls.Docking.DockingWindow A_0 = {DesignerBrowser.DesignerToolWindow}, ActiproSoftware.Windows.Controls.Docking.DockingWindowCloseReason A_1 = Other, bool A_2 = false) + 0x388 bytes    
     ActiproSoftware.Docking.Wpf30.dll!ActiproSoftware.Windows.Controls.Docking.DockingWindow.Close() + 0x48 bytes    
     ActiproSoftware.Docking.Wpf30.dll!ActiproSoftware.Windows.Controls.Docking.DockingWindowContainer.b(object A_0 = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.Input.ExecutedRoutedEventArgs A_1 = {System.Windows.Input.ExecutedRoutedEventArgs}) + 0x141 bytes    
     PresentationCore.dll!System.Windows.Input.CommandBinding.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) + 0x63 bytes    
     PresentationCore.dll!System.Windows.Input.CommandManager.ExecuteCommandBinding(object sender, System.Windows.Input.ExecutedRoutedEventArgs e = {System.Windows.Input.ExecutedRoutedEventArgs}, System.Windows.Input.CommandBinding commandBinding) + 0x97 bytes    
     PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(System.Windows.Input.CommandBindingCollection commandBindings = {System.Windows.Input.CommandBindingCollection}, object sender = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.RoutedEventArgs e = {System.Windows.Input.ExecutedRoutedEventArgs}, System.Windows.Input.ICommand command = {System.Windows.Input.RoutedUICommand}, bool execute = true) + 0x10b bytes    
     PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(object sender = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.RoutedEventArgs e = {System.Windows.Input.ExecutedRoutedEventArgs}, System.Windows.Input.ICommand command = {System.Windows.Input.RoutedUICommand}, bool execute = true) + 0x127 bytes    
     PresentationCore.dll!System.Windows.Input.CommandManager.OnExecuted(object sender = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.Input.ExecutedRoutedEventArgs e = {System.Windows.Input.ExecutedRoutedEventArgs}) + 0x26 bytes    
     PresentationCore.dll!System.Windows.UIElement.OnExecutedThunk(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) + 0x44 bytes    
     PresentationCore.dll!System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object target) + 0x3e bytes    
     PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x27 bytes    
     PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x3e bytes    
     PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.RoutedEventArgs args = {System.Windows.Input.ExecutedRoutedEventArgs}, bool reRaised = false) + 0x1bf bytes    
     PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender = {ActiproSoftware.Windows.Controls.Docking.ToolWindowContainer}, System.Windows.RoutedEventArgs args = {System.Windows.Input.ExecutedRoutedEventArgs}) + 0x79 bytes    
     PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args = {System.Windows.Input.ExecutedRoutedEventArgs}, bool trusted) + 0x35 bytes    
     PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteImpl(object parameter, System.Windows.IInputElement target, bool userInitiated) + 0x11a bytes    
     PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteCore(object parameter, System.Windows.IInputElement target, bool userInitiated) + 0x48 bytes    
     PresentationFramework.dll!MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource commandSource, bool userInitiated) + 0x79 bytes    
     PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnClick() + 0x44 bytes    
     PresentationFramework.dll!System.Windows.Controls.Button.OnClick() + 0x53 bytes    
     ActiproSoftware.Shared.Wpf30.dll!ActiproSoftware.Windows.Controls.PopupButton.OnClick() + 0xd2 bytes    
[Modified at 01/10/2010 08:36 AM]

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jimmy,

We've not heard of that happening before, and from your stack trace it does look like something that could be in Microsoft's code. Although perhaps we could find a way to work around it.

For things like this please always just email us a simple sample project with instructions that repro the issue instead of posting here. This ensures we have something immediately that shows it that we can debug with. Thanks, we'll wait for your email.


Actipro Software Support

Posted 14 years ago by Jim Strav
Avatar
FYI...I've refactored a lot of my code and this no longer happens.
The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.