New to Telerik UI for WPF? Download free 30-day trial

Calling thread cannot access this object when opening RadDocking on another UI thread


Product RadDocking for WPF
Version 2019.2.618


InvalidOperationException is thrown when RadDocking is hosted in a window that can be opened on separate UI threads.

The exception message is: "The calling thread cannot access this object because a different thread owns it."


This happens because of a MouseBinding defined in the InputBindings collection of one of the RadDocking visuals (the PaneHeader element).

To avoid the issue, you can add a new Style for the PaneHeader element in the Resources of the window that opens on the new UI thread.

    <!--If you use NoXaml dlls please add BasedOn="{StaticResource PaneHeaderStyle}" to the Style object. For example: --> 
    <!--<Style TargetType="telerik:PaneHeader" BasedOn="{StaticResource PaneHeaderStyle}" >--> 
    <Style TargetType="telerik:PaneHeader"> 
        <Setter Property="telerik:InputBindingsManager.InputBindings"> 
                    <MouseBinding Command="telerikDocking:RadDockingCommands.PaneHeaderMenuOpen"> 
                            <MouseGesture MouseAction="RightClick" /> 
In some cases, you may need to merge this Style in the Resources of the opened ToolWindow. To do this, you can use the ToolWindowCreated event of RadDocking, where you can access the Resources of the window in code-behind.
In this article