[Version 2.0] AnchorableTemplateSelector

Mar 6, 2012 at 3:21 PM

Is there going to be one eventually or should I be using something else to select the DataTemplate for Anchorables.

I see the AnchorableTitleTemplateSelector and also a section where it perhaps should be (#region LayoutDocument & LayoutAnchorable Templates)

Maybe I am a little too eager and should just wait more patiently :)


Mar 6, 2012 at 4:20 PM

Just a bit :)
now you have the AnchorableTemplate/Selector with the latest changeset,

(the AnchorableTitleTemplate/Selector is for the anchorables title)


Mar 6, 2012 at 8:27 PM

Nice :)

Don't want to be a pest (but maybe I'm helping out!)... It appears that AttachAnchorablesSource and DetachAnchorablesSource had each other's names mixed up...

I changed that but then my LayoutAnchorablePane isn't found here: (so I get no Anchorables in the Pane)

                //look for an available pane
                anchorablePane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault();

This is my XAML:

                <adl:LayoutPanel Orientation="Horizontal">

                    <adl:LayoutAnchorablePane DockWidth="100" />

                        <adl:LayoutDocumentPane />


Steve :)

Mar 6, 2012 at 9:21 PM


It appears that my LayoutAnchorablePane wasn't found because the AncorablesSource dependency property is being set before the visual tree is rendered from LayoutRoot in XAML.

I tried refreshing the property after DockingManager loads and now it finds the LayoutAnchorablePane and adds children to it but nothing renders on screen.

I think I'll leave you to have a look at it for a while :)

This was my modified Loaded handler:

        void DockingManager_Loaded(object sender, RoutedEventArgs e)
            if (!DesignerProperties.GetIsInDesignMode(this))
                foreach (var fw in _fwList)
                    fw.Owner = Window.GetWindow(this);


                IEnumerable anchorablesSource = AnchorablesSource;
                AnchorablesSource = null;
                AnchorablesSource = anchorablesSource;

                IEnumerable documentsSource = DocumentsSource;
                DocumentsSource = null;
                DocumentsSource = documentsSource;