Flyout window is empty when binding

Jun 24, 2008 at 6:49 PM
Hi!
Firstly, thanks for sharing us this control. It is extremely awaresome!
I've been integrating it into one of my projects. One problem seems to happen to me. When I use binding to get data displaying in a DocktableContent like this


ad

:DocumentPane x:Name="dockingHost">

 

 

<ad:DockableContent>

 

 

<ContentControl x:Name="openProjectsArea" Content="{Binding OpenProjectListViewModel}"/>

 

 

</ad:DockableContent>

 

 

</ad:DocumentPane>

 

The content is display correctly in the window. But the flyout window doesn't likely display it. It just display an empty window.

Is it a bug or I havent used the control correctly?
Thanks for your answer!


Jun 26, 2008 at 2:44 PM
Hi, why are you binding to a control (I suppose "OpenProjectListViewModel" is property returning a listview)?
You should always bind to data, I immagine you can try with code like this:

<ad:DockableContent>

 <ContentControl  x:Name="openProjectsArea">

    <ListBox x:Name="openProjectsList" ItemSource="{Binding OpenProjectList}"/>

 </ContentContol>

</ad:DockableContent>

Jun 27, 2008 at 9:36 AM
Hi adospace,
thanks for your feedback. I've just solved the problem. In fact, here is the discussion related to my problem.

http://www.codeplex.com/AvalonDock/WorkItem/View.aspx?WorkItemId=5336


The solution is, you have to explicitly set the DataContext to the DockableContent that Flyout windows can inherit to pull the infos.

Your control really rocks!
Jun 27, 2008 at 4:26 PM
Thank you minhquang104!