Hi all. First i would like to say that AvalonDock is a great piece of work, which i hope that will personally give a solution to a lot of programming headaches.
However, i am new in using this, and i am facing the following problem:
1. I added a DocumentContent window (created in Xaml under the name of main3D2Dwindow) and added it in a documentpane (name CADHost) in the main window1 where the dockmanager exists. For this purpose i used: CADHost.Items.Add(main3D2Dwindow) that is
invocked with the Window_Loaded. This works OK.
2. I added a button whick, when clicked will have to perform the following tasks:
- make this documentcontent Active if not (i used the SetAsActive())... This works OK
- if closed as documentcontent, to Add it again in the documentpane (i used the CADHost.Items.Add(main3D2Dwindow))... this works OK
- If is on a Floating Window state and Closed, then "show" it again. Here i face the problem. The window floats normally and i Close it using the X button, but i cannot show it again!...I tried different methods but nothing seems to
if i use the dockmanager.Show(main3D2Dwindow) or
try to Add it again using the CADHost.Items.Add(main3D2Dwindow),
i always get the same error: "Element already has a logical parent. It must be detached from the old parent before it is attached to a new one."
I even tried to first use the Remove() and then Add() but i have the same problem.
I am sure that i am making a very basic error but i just cannot track it...
Any help is really appreciated.