Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Can not set ContentPane.Header when it comes from a controltemplate
posted

Hello,

1. I have a Control template in the resource of an XamDockManager:

The special is that the Header cotnains a header presenter and a label - with a string in the header the problem doesn't occur.

<igDock:XamDockManager  Name="DockManager">
                <igDock:XamDockManager.Resources>
                    <ControlTemplate x:Key="ContentPaneTemplate">
                        <igDock:ContentPane>
                            <igDock:ContentPane.Header>
                                <igDock:PaneHeaderPresenter>
                                    <Label>hello</Label>
                                </igDock:PaneHeaderPresenter>
                             </igDock:ContentPane.Header>
                            <TextBox Text="..."/>
                        </igDock:ContentPane>
                    </ControlTemplate>
                </igDock:XamDockManager.Resources>
                <igDock:DocumentContentHost>
                    <igDock:SplitPane Name="ContentSplitPane">
                        <igDock:TabGroupPane Name="ContentTabGroupPane">
                        </igDock:TabGroupPane>
                    </igDock:SplitPane>
                </igDock:DocumentContentHost>
            </igDock:XamDockManager>

2. I Load this template in the code behind:

    Private Function CreateContentPane() As ContentPane
        Return DirectCast(DirectCast(Me.DockManager.Resources.Item("ContentPaneTemplate"), ControlTemplate).LoadContent, ContentPane)
    End Function

3. I assign the content pane as content of a microsoft-wpf-control:

Me.TestButton.Content = CreateContentPane

4. TestCase 3. works. So i assume i didn't do something wrong. Also with a ms-tabcontrol it works. That's why i assume it is an bug in your implementation:

5. Now if i assign the aContent to the header of a IgDock.ContentPane:

Me.ContentTabGroupPane.Items.Add(Me.CreateContentPane)

6. For the first it works but later when the messagequeue is processed i receive an error that an element is allready child of another logical parent.

7. I receive the same error immediately when i try to set the aContentPane as SelecteItem of the TabPane:

Dim aContentPane As ContentPane = Me.CreateContentPane()

Me.ContentTabGroupPane.Items.Add(aContentPane)

Me.ContentTabGroupPane.SelectedItem = aContentPane ' error