This project is read-only.

Is it bug ? Avalon dock on WPF usercontrol with parent WinForm

Feb 2, 2009 at 3:39 PM
I am creating application with winform, as per my requriment we have one WPF control on that winform. In WPF Usercontrol we are using AvalonDock. I  have created one DocumentPane and
DockablePane. Both has some controls in it. All the controls are docked properly. The problem is when  DockablePane flies in. It won't flies out,
      When I debugged Avalondock control i am seeing in follwoing function,  I am getting ParentWindow as null so it is reurning back without flying out DockablePane
 
internal void ShowFlyoutWindow(DockableContent content)
        {
            ////check if parent window is Active           
            Window parentWindow = Window.GetWindow(this);
            if (parentWindow == null ||
                !parentWindow.IsActive)
                return;
.....
}


following is the xaml

<UserControl x:Class="AvlonSampleControl.UserControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"       
    Height="481" Width="443" Background="Bisque">
    <UserControl.Resources>
        <Style x:Key="{x:Type ListViewItem}" TargetType="ListViewItem">
            <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
        </Style>
    </UserControl.Resources>
    <DockPanel LastChildFill="True">
    <ContentControl x:Name="TestContainer">        
    <ad:DockingManager Name="_DockingManager">
        <ad:ResizingPanel>
            
            <ad:DocumentPane>
                <ad:DockableContent Title="AlarmView Dock Test">
                    <WrapPanel>
                        <ListView  Name="lstview_Unack" Grid.Row="1" Margin="2,0,0,0">
                            <ListView.ItemContainerStyle>
                                <Style TargetType="ListViewItem">
                                    <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                                </Style>
                            </ListView.ItemContainerStyle>
                        </ListView>                    
                        <Button Grid.Row="2" Margin="93,6,14,6" Name="btnAcknowledge">Acknowledge</Button>
                        <ListView  Name = "lstview_Ack" Grid.Row="3" Margin="2,1,0,0">
                            <ListView.ItemContainerStyle>
                                <Style TargetType="ListViewItem">
                                    <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
                                </Style>
                            </ListView.ItemContainerStyle>
                        </ListView>
                        <Button Grid.Row="4" HorizontalAlignment="Left" Margin="16,12,0,7" Name="Clear" Width="78">Clear</Button>
                        <TextBox Margin="110,6,32,5" Name="FilterText"/>
                        <ComboBox HorizontalAlignment="Left" Margin="14,5,0,4" Name="comboColumnList" Width="94" />
                    </WrapPanel>
             </ad:DockableContent>
            </ad:DocumentPane>
            
            <ad:DockablePane>
                <ad:DockableContent Title="TreeView Filter" DockableStyle="AutoHide">
                    <TreeView  x:Name ="m_objDeviceTree" Margin="25,33.326,49,157.674">

                    </TreeView>
                </ad:DockableContent>
            </ad:DockablePane>            
        </ad:ResizingPanel>
    </ad:DockingManager>
  </ContentControl>
        </DockPanel>
</UserControl>