0

I cannot disable floating for my LayoutAnchorablePanes. My xaml looks like this

 <DockPanel>
    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
        <Grid>
            <avalonDock:DockingManager x:Name="dockManager">
                <avalonDock:LayoutRoot>

                    <avalonDock:LayoutPanel>
                        <avalonDock:LayoutAnchorablePaneGroup DockWidth="420"
                                                              Orientation="Vertical">

                            <avalonDock:LayoutAnchorablePane >
                                <avalonDock:LayoutAnchorable Title="Main"
                                                             CanClose="False"
                                                             CanHide="False"
                                                             CanFloat="False"
                                                             ContentId="1">

                                    //Some Content here...

                               </avalonDock:LayoutAnchorable>
                            </avalonDock:LayoutAnchorablePane>

                        </avalonDock:LayoutAnchorablePaneGroup>
                    </avalonDock:LayoutPanel>
                </avalonDock:LayoutRoot>
            </avalonDock:DockingManager>
        </Grid>
    </ScrollViewer>
</DockPanel>

My problem is even with the CanFloat property set to false, I can float my window. Does anybody know what I'm doing wrong?

user3596113
  • 868
  • 14
  • 32

1 Answers1

0

Simply try to create new test solution. I did it with your code you posted above and I’m not able to float that window:

<Window x:Class="WpfApplication2.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel>
        <ScrollViewer HorizontalScrollBarVisibility="Disabled">
            <Grid>
                <avalonDock:DockingManager x:Name="dockManager">
                    <avalonDock:LayoutRoot>
                        <avalonDock:LayoutPanel>
                            <avalonDock:LayoutAnchorablePaneGroup DockWidth="420" Orientation="Vertical">
                                <avalonDock:LayoutAnchorablePane >
                                    <avalonDock:LayoutAnchorable Title="Main"
                                                             CanClose="False"
                                                             CanHide="False"
                                                             CanFloat="False"
                                                             ContentId="1">

                                    </avalonDock:LayoutAnchorable>
                                </avalonDock:LayoutAnchorablePane>
                            </avalonDock:LayoutAnchorablePaneGroup>
                        </avalonDock:LayoutPanel>
                    </avalonDock:LayoutRoot>
                </avalonDock:DockingManager>
            </Grid>
        </ScrollViewer>
    </DockPanel>
</Window>

Try it and then add next chunks of your code to find where is the problem …

Jofta
  • 94
  • 1
  • 1
  • 4
  • Thats strange its working for me now too. But not only floating is disabled now, I cannot dock my windows aswell (I have multiple LayoutAnchorablePanes in my LayoutAnchorablePaneGroup and want to be able to rearrange them). – user3596113 May 29 '15 at 08:18
  • If you want to rearrange that anchorables I think you cannot do that without enabled floating … – Jofta May 29 '15 at 08:41