Error “Specified element is already the logical child of another element”?

前端 未结 3 928
离开以前
离开以前 2021-02-13 12:22

I have a TabControl and each Tab can contain the same UI but with different data. In any tab the user can click on a button and bring up a popup. This sets a Style property to t

3条回答
  •  既然无缘
    2021-02-13 13:10

    My problem was I was setting the Content in my Style, and Content cannot have more then one logical parent. I needed to move that to a Template instead. Since I didn't want to lose the base style, I set the content in the ContentTemplate property of the HeaderedContentControl (DraggablePanel in my code).

    +1 to Davy anyways for helping me walk through this.

提交回复
热议问题