Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

New Post: Separately Docked Windows

$
0
0
I have 7 different view models that all need to be displayed in different LayoutAnchorable windows. I don't want them to start out tabbed. Ideally, I would like to have a flexible layout, not just 7 windows vertical or horizontal, but I could settle for that layout.

I am able to achieve the layout I want by using multiple nested LayoutPanels with different Orientations. But, when I do this, I have to "hardcode" the View Model with a ContentControl, I can't figure out how to use a data attribute on my ViewModel to set the Title and Visibility of the LayoutAnchorable.

Using this code, I am able to bind all the values I need to drive visibility, titles, etc. How can I layout the "anchorables" so they are not all together in one tabbed group to start with?
<xcad:DockingManager x:Name="ViewDockingManager" AnchorablesSource="{Binding ListOfViewModels}" 
                     Margin="0,0,0,40" Grid.Row="2">
    <xcad:DockingManager.LayoutItemContainerStyle>
        <Style TargetType="{x:Type xcad:LayoutAnchorableItem}">
            <Setter Property="Title" Value="{Binding Model.DisplayName}"/>
            <Setter Property="CanFloat" Value="True" />
            <Setter Property="CanHide" Value="False"/>
            <Setter Property="Visibility" Value="{Binding Model.IsVisible, Converter={StaticResource booleanToVisibilityConverter}}"/>
        </Style>
    </xcad:DockingManager.LayoutItemContainerStyle>

    <xcad:DockingManager.LayoutItemTemplate>
        <DataTemplate>
            <ContentControl cal:View.Model="{Binding .}" />
        </DataTemplate>
    </xcad:DockingManager.LayoutItemTemplate>

    <xcad:LayoutRoot>
        <xcad:LayoutPanel/>
    </xcad:LayoutRoot>
</xcad:DockingManager>
Thanks!

Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>