Question

Use DockSite in UserControl with the new version ActiPro 17.2.665.0

Posted 4 months ago by Avatar Gerald Lochner

With the version 13 of ActiPro I used a DockSite in UserControl and it's working.

Now I try to use the version 17.2.665.0 (for corect the bug floating ToolWindow).

But my userControl dons't work.

I correct some part of code C# and WPF beacause there are some property changed.

The project compil good, I can see my UserControl in disgn mode xaml, but when I use my UserControl in new Windows I have a problem in disgn mode on xaml.

Error : This operation is invalid since the DockingWindow has not yet been registerd with a DockSite.

StackTrace : ActiproSoftware.Windows.Controls.Docking.ToolWindow.AutoHideCore(Nullable'1 side)

 

<UserControl x:Class="Aucotec.EngineeringBase.Client.PlugIns.Manufacturing.View.HarnessGraphic2DEditorControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking" 
             mc:Ignorable="d" 
             d:DesignHeight="531.333" d:DesignWidth="1282.667" PreviewKeyDown="UserControl_PreviewKeyDown">


    <docking:DockSite Name="dockSiteMain">
            <docking:SplitContainer>

                <docking:Workspace>

                    <Grid>
                        ...

                    </Grid>
                </docking:Workspace>

                <docking:ToolWindowContainer>
                    <docking:ToolWindow Name="twOptions" CanClose="False" Title="{Binding Path=Localizing.GrpSettings}">
                        <StackPanel>
                            
                           ...
                        </StackPanel>
                    </docking:ToolWindow>
                    <docking:ToolWindow Name="twPosition" Title="{Binding Path=Localizing.GrpPosition}" CanClose="False">
                        <Grid>
                            ...

                        </Grid>
                    </docking:ToolWindow>
                </docking:ToolWindowContainer>
                <docking:ToolWindowContainer>
                    <docking:ToolWindow Name="twSelectPath" 
                                    Title="{Binding Path=Localizing.BtnSelectRoutingPath}" CanClose="False">
                        <StackPanel>
                            ...

                        </StackPanel>
                    </docking:ToolWindow>
                </docking:ToolWindowContainer>
            </docking:SplitContainer>
     </docking:DockSite>

   
</UserControl>

Comments (1)

Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

You mentioned getting an error "This operation is invalid since the DockingWindow has not yet been registered with a DockSite.".  That happens if you try to open a docking window in a DockSite and that docking window hasn't been registered on the DockSite or wasn't defined in its XAML.  You need to make sure that if you programmatically create a docking window, you use one of its constructors that takes a DockSite argument.  That will register it so that it can be used with the DockSite.

You mentioned it coming from an auto-hide related method, but I didn't see any auto-hide containers above.  That's why I'm assuming you are creating that docking window programmatically.  Is that true?  Also are you seeing it at run-time as well, or only at design-time?

Finally, I would recommend that you alter your bindings for Title.  Right now, you are using inherited data contexts, but as soon as you float one of those docking windows, the data context will change since they are no longer in the same UserControl.  Instead, you can do bindings like this to make sure they are maintained properly, even when floating:

"{Binding ElementName=dockSiteMain, Path=DataContext.Localizing.GrpPosition}"


Actipro Software Support
Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.