DefaultElement using problem

Sep 10, 2009 at 6:46 AM

Hi, Ado!

Xaml of my Window:
<Window x:Class="AvalonDockTest.Window2"
    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"
    xmlns:local="clr-namespace:AvalonDockTest"
    Title="Example" Height="600" Width="800" >
    <ad:DockingManager>
        <ad:ResizingPanel Orientation="Horizontal" >
            <ad:DocumentPane>
                <ad:DockableContent Title="DM1">
                    <ad:DockingManager>
                        <ad:ResizingPanel Orientation="Horizontal" >
                            <ad:DockablePane>
                                <local:MyDockableContent Title="DC1_DM1"/>
                            </ad:DockablePane>
                            <ad:DockablePane>
                                <local:MyDockableContent Title="DC2_DM1"/>
                            </ad:DockablePane>
                        </ad:ResizingPanel>
                    </ad:DockingManager>
                </ad:DockableContent>
            </ad:DocumentPane>
            <ad:DocumentPane>
                <ad:DockableContent Title="DM2">
                    <ad:DockingManager>
                        <ad:ResizingPanel Orientation="Horizontal" >
                            <ad:DockablePane>
                                <local:MyDockableContent Title="DC1_DM2"/>
                            </ad:DockablePane>
                            <ad:DockablePane>
                                <local:MyDockableContent Title="DC2_DM2"/>
                            </ad:DockablePane>
                        </ad:ResizingPanel>
                    </ad:DockingManager>
                </ad:DockableContent>
            </ad:DocumentPane>
        </ad:ResizingPanel>
    </ad:DockingManager>
</Window>

MyDockableContent:
<ad:DockableContent x:Class="AvalonDockTest.MyDockableContent"
    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"
    >
    <StackPanel>
        <TextBox Name="text"/>
        <CheckBox Name="checkBox">CheckBox</CheckBox>
    </StackPanel>
</ad:DockableContent>
+
public partial class MyDockableContent : DockableContent
{
    public MyDockableContent()
    {
        InitializeComponent();
        DefaultElement = text;
    }
}

Now about problem:
1. Run program.
2. Do "DC2_DM1" as DockableFloatingWindow by drag and drop.
3. Do "DC2_DM2" as DockableFloatingWindow by drag and drop.
4. Click DC2_DM1 window.
5. Try set active DC1_DM1 by click. ---> Problem!!! (It is impossible to set focus).

Eugene