Skip to content

Commit

Permalink
Add binding to DockingManager.AnchorTemplateProperty when adding Layo…
Browse files Browse the repository at this point in the history
…utAnchorControl child in LayoutAnchorGroupControl
  • Loading branch information
Dirkster99 committed Oct 6, 2019
1 parent 7f6646b commit f0afbfe
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This program is provided to you under the terms of the Microsoft Public
using System.Collections.ObjectModel;
using Xceed.Wpf.AvalonDock.Layout;
using System.Windows;
using System.Windows.Data;

namespace Xceed.Wpf.AvalonDock.Controls
{
Expand Down Expand Up @@ -75,7 +76,9 @@ private void CreateChildrenViews()
var manager = _model.Root.Manager;
foreach( var childModel in _model.Children )
{
_childViews.Add( new LayoutAnchorControl( childModel ) { Template = manager.AnchorTemplate } );
var lac = new LayoutAnchorControl( childModel );
lac.SetBinding( LayoutAnchorControl.TemplateProperty, new Binding( DockingManager.AnchorTemplateProperty.Name ) { Source = manager } );
_childViews.Add( lac );
}
}

Expand Down Expand Up @@ -105,7 +108,9 @@ private void OnModelChildrenCollectionChanged( System.Collections.Specialized.No
int insertIndex = e.NewStartingIndex;
foreach( LayoutAnchorable childModel in e.NewItems )
{
_childViews.Insert( insertIndex++, new LayoutAnchorControl( childModel ) { Template = manager.AnchorTemplate } );
var lac = new LayoutAnchorControl( childModel );
lac.SetBinding( LayoutAnchorControl.TemplateProperty, new Binding( DockingManager.AnchorTemplateProperty.Name ) { Source = manager } );
_childViews.Insert( insertIndex++, lac );
}
}
}
Expand Down

0 comments on commit f0afbfe

Please sign in to comment.