ToolWindow loosing position and adding child to animatedCanvas

Docking/MDI for WPF Forum

Posted 9 years ago by Sasha
Version: 14.2.0611

Hi I have two questions.

1. I have a DockSite element. In this element I have some AutoHideLeftContainers. Here is a XAML code to demonstrate one of the ToolWindows:

         <docking:ToolWindow Title="{DynamicResource UnconfirmedAlarms}" TabIndex="4"
                             CanClose="False" HasOptions="False" 
                             actiproFiles:ToolWindowTabFlashBehavior.IsFlashing="{Binding UnconfirmedAlarmIsFlashing}"
             <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                 <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                     <StackPanel Orientation="Vertical">
                         <ComboBox />
                         <ThemedDataGrid />

 Inside ThemedDataGrid we handle MouseLeftButtonUp event (we want to dock this toolWindow on mouseClick, if it is not docked). The code is :

 public void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
     var dg = sender as DataGrid;
     if (null == dg) return;
     var stackPanel = dg.Parent as StackPanel;
     if (null != stackPanel)
         var scrollViewer = stackPanel.Parent as ScrollViewer;
         if (null != scrollViewer)
             var dockPanel = scrollViewer.Parent as DockPanel;
             if (null != dockPanel)
                 var toolWindow = dockPanel.Parent as ToolWindow;
                 if (null != toolWindow)
                     if(toolWindow.State != DockingWindowState.Docked)

 So far everything works. But if to click unpin button(right upper corner of toolWindow) this ToolWindow goes to the end of the list(we have more than 1 toolWindow) and we want it to be with fixed position. Pinning and unpinning form view works without changing toolWindow position. How can we unpin element without loosing it's position?


2. In the DockSite we have an opportunity to add DocumentItems:

<docking:DockSite viewModels:DockSiteViewModelBehavior.IsManaged="true" CanDocumentWindowsRaft="True" ItemContainerRetentionMode="Wrapped"
                          DocumentItemsSource="{Binding DocumentItems}" ToolItemsSource="{Binding ToolItems}">

 and DocumentItem is:

<docking:DocumentWindow x:Class="Test"
        Title="{Binding Title}">
        <views:AnimatedCanvas x:Name="AnimatedCanvasOfDocumentWindow" ZIndex="0"/>

 In my viewModel I want to add dynamically visual controls to AnimatedCanvas:


 But it is placed always in the left upper corner. How can I set position to the control?

Thank you.

[Modified 9 years ago]

Comments (3)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Sasha,

1) I'm not sure I fully understand the problem here and might need more detail.  Are you saying that you are not happy with where the tool window goes when it enters auto-hide mode (becomes a tab on the outside of the DockSite)?  If so, how would you rather it be?  Perhaps some screenshots would help. 

Or are you saying when you restore it back to a Docked state you aren't seeing it go where you want.  The Dock() method you are calling is the right thing to do to restore it to Docked state and it should go back where it was before.

2) You can arrange children of the AnimatedCanvas with these attached properties:

AnimatedCanvas.SetLeft(child, x);

AnimatedCanvas.SetTop(child, y);

Actipro Software Support

Posted 9 years ago by Sasha


thank you for your answer.

1. The issue is that the toolWindow does not go back where it was before. For example at the beginning a toolWindow was at the second position, and then, after it was Docked, goes back, but to last position. Not sure how can I attach here a screenshot...


2. It helps.

[Modified 9 years ago]

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Sasha,

Ok for restoring to auto-hide mode, that is correct.  It is moving the tabs to the bottom of the list right now.  We are working on a major reimplementation of all logic in the Docking/MDI product.  The updates should be out later this year.  We will mark down this request to try and get that feature in.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.