AvlonDock 2.0 and Caliburn Micro

Topics: Conventions, Extensibility
Jan 27, 2013 at 9:55 AM


I'm trying to use AvalonDock 2.0 with Caliburn, the first problem I encounter is how to use the Autobinder to setup a ViewModel against a View, this does not work

    <avalondock:LayoutAnchorable Title="My View">
        <ContentControl x:Name="MyViewModel" />

I'm guessing Caliburn cant intercept the content control inside the avalon control?

Jan 27, 2013 at 6:10 PM
Edited Jan 27, 2013 at 6:10 PM

there a few examples of using a docking system just do a search, it wasn't specific to avalon


Jan 27, 2013 at 9:11 PM
Edited Jan 27, 2013 at 9:15 PM

I got that part working based on the MVVM example. Looks like this now

            AnchorablesSource="{Binding Tools}"
            DocumentsSource="{Binding Scripts}"
            ActiveContent="{Binding ActiveScript, Mode=TwoWay}">
                <Style TargetType="{x:Type avalondock:LayoutItem}">
                    <Setter Property="Title"
                Value="{Binding Model.Title}" />
                            <ContentControl cal:View.Model="{Binding . }" IsTabStop="False" />
                <avalondock:LayoutPanel Orientation="Vertical">
                    <avalondock:LayoutAnchorablePane DockHeight="150">

Important part is

<ContentControl cal:View.Model="{Binding . }" IsTabStop="False" />

Each model needs to Inherit from a Base thats have a Title property

Jan 28, 2013 at 6:49 AM

Also you might have a look at Gemini from Tim Jones.

Jan 28, 2013 at 6:59 AM
Edited Jan 28, 2013 at 7:00 AM

Thanks saw that one, but it was a bit hefty for me, it takes a way the Micro form Caliburn. But the above stuff works nice.