1
Vote

Missing Close button

description

I've updated my AvalonDock from 2.0 to 3.2 (the latest build). I had the same problem with 2.9, but I hoped it would be gone in the further build. Maybe somebody had the same problem? My Close button is missing (I wanted to pragmatically control if the user can close a module/LayoutAnchroable with MVVM/Caliburn.Micro) and the AutoHide button is there, even when CanHide is set to False.
<dock:DockingManager x:Name="ModulesDock" ActiveContent="{Binding ActiveAnchor, Mode=TwoWay}" BorderThickness="1" BorderBrush="Black"
                         AnchorablesSource="{Binding AnchorViewModels}" AllowMixedOrientation="True" 
                             cal:Message.Attach="[Event Loaded] = [Action LoadLayout($source)]; [Event Unloaded] = [Action SaveLayout($source)]" >
            <dock:DockingManager.Theme>
                <dock:AeroTheme/>
            </dock:DockingManager.Theme>
            <dock:DockingManager.LayoutItemContainerStyleSelector>
                <docking:PanesStyleSelector>
                    <docking:PanesStyleSelector.LayoutStyle>
                        <Style TargetType="{x:Type dock:LayoutAnchorableItem}">
                            <Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
                            <Setter Property="Title" Value="{Binding Model.DisplayName}"/>
                            <Setter Property="IconSource" Value="{Binding Model.Icon, Mode=TwoWay}"/>
                            <Setter Property="CanClose" Value="True"></Setter>
                            <Setter Property="CanHide" Value="False"></Setter>
                            <Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"></Setter>
                            <Setter Property="CanFloat" Value="True"></Setter>
                        </Style>
                    </docking:PanesStyleSelector.LayoutStyle>
                </docking:PanesStyleSelector>
            </dock:DockingManager.LayoutItemContainerStyleSelector>

            <dock:DockingManager.LayoutItemTemplateSelector>
                <docking:AutobinderTemplateSelector>
                    <docking:AutobinderTemplateSelector.Template>
                        <DataTemplate >
                            <ContentControl cal:View.Model="{Binding . }" cal:Message.Attach="[Closing] = [OnClose($dataContext)]" IsTabStop="False" />
                        </DataTemplate>
                    </docking:AutobinderTemplateSelector.Template>
                </docking:AutobinderTemplateSelector>
            </dock:DockingManager.LayoutItemTemplateSelector>
            <dock:LayoutRoot >
                <dock:LayoutPanel>

                </dock:LayoutPanel>
            </dock:LayoutRoot>
        </dock:DockingManager>

comments