diff --git a/source/Components/AvalonDock.Themes.VS2013/Images/HTabGroup.png b/source/Components/AvalonDock.Themes.VS2013/Images/HTabGroup.png
deleted file mode 100644
index 4c50d26d..00000000
Binary files a/source/Components/AvalonDock.Themes.VS2013/Images/HTabGroup.png and /dev/null differ
diff --git a/source/Components/AvalonDock.Themes.VS2013/Images/VTabGroup.png b/source/Components/AvalonDock.Themes.VS2013/Images/VTabGroup.png
deleted file mode 100644
index c3f279f7..00000000
Binary files a/source/Components/AvalonDock.Themes.VS2013/Images/VTabGroup.png and /dev/null differ
diff --git a/source/Components/AvalonDock.Themes.VS2013/Themes/Generic.xaml b/source/Components/AvalonDock.Themes.VS2013/Themes/Generic.xaml
index ed187c2e..02286dc0 100644
--- a/source/Components/AvalonDock.Themes.VS2013/Themes/Generic.xaml
+++ b/source/Components/AvalonDock.Themes.VS2013/Themes/Generic.xaml
@@ -32,6 +32,8 @@
+
+
+
+
-
-
+
-
+
-
@@ -1366,9 +1373,12 @@
Header="{x:Static avalonDockProperties:Resources.Document_NewVerticalTabGroup}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
-
@@ -1433,7 +1443,10 @@
-
+
-
+
-
+
+
-
-
+
+
M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+ VerticalAlignment="Center"
+ Data="M0,0 L0,8 L4,4 z"
+ Fill="{TemplateBinding Foreground}" />
-
+
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/source/Components/AvalonDock/Controls/DropDownControlArea.cs b/source/Components/AvalonDock/Controls/DropDownControlArea.cs
index 5c1fc16d..ea310385 100644
--- a/source/Components/AvalonDock/Controls/DropDownControlArea.cs
+++ b/source/Components/AvalonDock/Controls/DropDownControlArea.cs
@@ -21,8 +21,8 @@ namespace AvalonDock.Controls
///
/// The content is usually displayed via ContentPresenter binding in the theme definition.
///
- ///
- public class DropDownControlArea : UserControl
+ ///
+ public class DropDownControlArea : ContentControl
{
#region Properties
diff --git a/source/Components/AvalonDock/DockingManager.cs b/source/Components/AvalonDock/DockingManager.cs
index 0811b7a5..1f070d17 100644
--- a/source/Components/AvalonDock/DockingManager.cs
+++ b/source/Components/AvalonDock/DockingManager.cs
@@ -27,2618 +27,2631 @@ This program is provided to you under the terms of the Microsoft Public
namespace AvalonDock
{
- ///
- ///
- ///
- /// The is the custom control at the root of the visual tree.
- /// This control is the core control of AvalonDock.
- /// It contains core dependency properties, events, and methods to customize and
- /// manage many aspects of the docking framework.
- ///
- ///
- ///
- [ContentProperty(nameof(Layout))]
- [TemplatePart(Name = "PART_AutoHideArea")]
- public class DockingManager : Control, IOverlayWindowHost//, ILogicalChildrenContainer
- {
- #region fields
- private ResourceDictionary currentThemeResourceDictionary; // = null
- private AutoHideWindowManager _autoHideWindowManager;
- private FrameworkElement _autohideArea;
- private List _fwList = new List();
- private List _fwHiddenList = new List();
- private OverlayWindow _overlayWindow = null;
- private List _areas = null;
- private bool _insideInternalSetActiveContent = false;
-
- // Collection of LayoutDocumentItems & LayoutAnchorableItems attached to their corresponding
- // LayoutDocument & LayoutAnchorable
- private List _layoutItems = new List();
-
- private bool _suspendLayoutItemCreation = false;
- private DispatcherOperation _collectLayoutItemsOperations = null;
- private NavigatorWindow _navigatorWindow = null;
-
- internal bool SuspendDocumentsSourceBinding = false;
- internal bool SuspendAnchorablesSourceBinding = false;
- #endregion fields
-
- #region Constructors
- ///
- /// Static class constructor to support WPF property control registration.
- ///
- static DockingManager()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(DockingManager), new FrameworkPropertyMetadata(typeof(DockingManager)));
- FocusableProperty.OverrideMetadata(typeof(DockingManager), new FrameworkPropertyMetadata(false));
- HwndSource.DefaultAcquireHwndFocusInMenuMode = false;
- }
-
- ///
- /// Class constructor.
- ///
- public DockingManager()
- {
- IsVirtualizingDocument = true;
- IsVirtualizingAnchorable = true;
+ ///
+ ///
+ ///
+ /// The is the custom control at the root of the visual tree.
+ /// This control is the core control of AvalonDock.
+ /// It contains core dependency properties, events, and methods to customize and
+ /// manage many aspects of the docking framework.
+ ///
+ ///
+ ///
+ [ContentProperty(nameof(Layout))]
+ [TemplatePart(Name = "PART_AutoHideArea")]
+ public class DockingManager : Control, IOverlayWindowHost//, ILogicalChildrenContainer
+ {
+ #region fields
+ private ResourceDictionary currentThemeResourceDictionary; // = null
+ private AutoHideWindowManager _autoHideWindowManager;
+ private FrameworkElement _autohideArea;
+ private List _fwList = new List();
+ private List _fwHiddenList = new List();
+ private OverlayWindow _overlayWindow = null;
+ private List _areas = null;
+ private bool _insideInternalSetActiveContent = false;
+
+ // Collection of LayoutDocumentItems & LayoutAnchorableItems attached to their corresponding
+ // LayoutDocument & LayoutAnchorable
+ private List _layoutItems = new List();
+
+ private bool _suspendLayoutItemCreation = false;
+ private DispatcherOperation _collectLayoutItemsOperations = null;
+ private NavigatorWindow _navigatorWindow = null;
+
+ internal bool SuspendDocumentsSourceBinding = false;
+ internal bool SuspendAnchorablesSourceBinding = false;
+ #endregion fields
+
+ #region Constructors
+ ///
+ /// Static class constructor to support WPF property control registration.
+ ///
+ static DockingManager()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(DockingManager), new FrameworkPropertyMetadata(typeof(DockingManager)));
+ FocusableProperty.OverrideMetadata(typeof(DockingManager), new FrameworkPropertyMetadata(false));
+ HwndSource.DefaultAcquireHwndFocusInMenuMode = false;
+ }
+
+ ///
+ /// Class constructor.
+ ///
+ public DockingManager()
+ {
+ IsVirtualizingDocument = true;
+ IsVirtualizingAnchorable = true;
#if !VS2008
- Layout = new LayoutRoot { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
+ Layout = new LayoutRoot { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
#else
this.SetCurrentValue( DockingManager.LayoutProperty, new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) } );
#endif
- Loaded += DockingManager_Loaded;
- Unloaded += DockingManager_Unloaded;
- }
-
- #endregion Constructors
+ Loaded += DockingManager_Loaded;
+ Unloaded += DockingManager_Unloaded;
+ }
+
+ #endregion Constructors
- #region Events
-
- /// Event fired when property changes.
- ///
- public event EventHandler LayoutChanged;
-
- /// Event fired when property is about to be changed.
- ///
- public event EventHandler LayoutChanging;
-
- /// Event fired when a document is about to be closed.
- /// Subscribers have the opportunity to cancel the operation.
- public event EventHandler DocumentClosing;
-
- /// Event fired after a document is closed.
- public event EventHandler DocumentClosed;
-
- /// Event is raised when changes.
- ///
- public event EventHandler ActiveContentChanged;
-
- #endregion Events
-
- #region Public Properties
-
- #region Layout
-
- /// dependency property.
- public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(nameof(Layout), typeof(LayoutRoot), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnLayoutChanged, CoerceLayoutValue));
-
- /// Gets or sets the property. This dependency property indicates layout tree.
- public LayoutRoot Layout
- {
- get => (LayoutRoot)GetValue(LayoutProperty);
- set => SetValue(LayoutProperty, value);
- }
-
- /// Coerces the value.
- private static object CoerceLayoutValue(DependencyObject d, object value)
- {
- if (value == null) return new LayoutRoot { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
- ((DockingManager)d).OnLayoutChanging(value as LayoutRoot);
- return value;
- }
-
- /// Handles changes to the property.
- private static void OnLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLayoutChanged(e.OldValue as LayoutRoot, e.NewValue as LayoutRoot);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayout)
- {
- if (oldLayout != null)
- {
- oldLayout.PropertyChanged -= OnLayoutRootPropertyChanged;
- oldLayout.Updated -= OnLayoutRootUpdated;
- }
-
- foreach (var fwc in _fwList.ToArray())
- {
- fwc.KeepContentVisibleOnClose = true;
- fwc.InternalClose();
- }
-
- _fwList.Clear();
-
- foreach (var fwc in _fwHiddenList.ToArray())
- {
- fwc.InternalClose();
- }
-
- _fwHiddenList.Clear();
- DetachDocumentsSource(oldLayout, DocumentsSource);
- DetachAnchorablesSource(oldLayout, AnchorablesSource);
-
- if (oldLayout != null && oldLayout.Manager == this)
- oldLayout.Manager = null;
-
- ClearLogicalChildrenList();
- DetachLayoutItems();
-
- Layout.Manager = this;
-
- AttachLayoutItems();
- AttachDocumentsSource(newLayout, DocumentsSource);
- AttachAnchorablesSource(newLayout, AnchorablesSource);
-
- if (IsLoaded)
- {
- LayoutRootPanel = CreateUIElementForModel(Layout.RootPanel) as LayoutPanelControl;
- LeftSidePanel = CreateUIElementForModel(Layout.LeftSide) as LayoutAnchorSideControl;
- TopSidePanel = CreateUIElementForModel(Layout.TopSide) as LayoutAnchorSideControl;
- RightSidePanel = CreateUIElementForModel(Layout.RightSide) as LayoutAnchorSideControl;
- BottomSidePanel = CreateUIElementForModel(Layout.BottomSide) as LayoutAnchorSideControl;
-
- foreach (var fw in Layout.FloatingWindows.ToArray())
- if (fw.IsValid)
- _fwList.Add(CreateUIElementForModel(fw) as LayoutFloatingWindowControl);
-
- foreach (var fw in _fwList.ToArray())
- {
- if (fw.Model is LayoutAnchorableFloatingWindow window && window.RootPanel.IsMaximized)
- {
- fw.WindowState = WindowState.Normal;
- fw.Show();
- fw.WindowState = WindowState.Maximized;
- }
- else
- {
- if (fw.Content != null || (fw.Model as LayoutAnchorableFloatingWindow)?.IsVisible == true)
- fw.Show();
- else
- fw.Hide();
- }
-
- //fw.Owner = Window.GetWindow(this);
- //fw.SetParentToMainWindowOf(this);
- }
-
- // In order to prevent resource leaks, unsubscribe from SizeChanged event for case when user call loading of Layout Settigns.
- SizeChanged -= OnSizeChanged;
- SizeChanged += OnSizeChanged;
- }
-
- if (newLayout != null)
- {
- newLayout.PropertyChanged += OnLayoutRootPropertyChanged;
- newLayout.Updated += OnLayoutRootUpdated;
- }
-
- LayoutChanged?.Invoke(this, EventArgs.Empty);
- // Layout?.CollectGarbage();
- CommandManager.InvalidateRequerySuggested();
- }
-
- #endregion Layout
-
- #region LayoutUpdateStrategy
-
- /// dependency property.
- public static readonly DependencyProperty LayoutUpdateStrategyProperty = DependencyProperty.Register(nameof(LayoutUpdateStrategy), typeof(ILayoutUpdateStrategy), typeof(DockingManager),
- new FrameworkPropertyMetadata((ILayoutUpdateStrategy)null));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the strategy class to call when AvalonDock needs to positionate a LayoutAnchorable inside an existing layout.
- ///
- /// Sometimes it's impossible to automatically insert an anchorable in the layout without specifing the target parent pane.
- /// Set this property to an object that will be asked to insert the anchorable to the desidered position.
- public ILayoutUpdateStrategy LayoutUpdateStrategy
- {
- get => (ILayoutUpdateStrategy)GetValue(LayoutUpdateStrategyProperty);
- set => SetValue(LayoutUpdateStrategyProperty, value);
- }
-
- #endregion LayoutUpdateStrategy
-
- #region DocumentPaneTemplate
-
- /// dependency property.
- public static readonly DependencyProperty DocumentPaneTemplateProperty = DependencyProperty.Register(nameof(DocumentPaneTemplate), typeof(ControlTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnDocumentPaneTemplateChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates .
- ///
- public ControlTemplate DocumentPaneTemplate
- {
- get => (ControlTemplate)GetValue(DocumentPaneTemplateProperty);
- set => SetValue(DocumentPaneTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnDocumentPaneTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ((DockingManager)d).OnDocumentPaneTemplateChanged(e);
- }
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentPaneTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- #endregion DocumentPaneTemplate
-
- #region AnchorablePaneTemplate
-
- ///
- /// dependency property
- ///
- public static readonly DependencyProperty AnchorablePaneTemplateProperty = DependencyProperty.Register(nameof(AnchorablePaneTemplate), typeof(ControlTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnAnchorablePaneTemplateChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates ....
- ///
- public ControlTemplate AnchorablePaneTemplate
- {
- get => (ControlTemplate)GetValue(AnchorablePaneTemplateProperty);
- set => SetValue(AnchorablePaneTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorablePaneTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorablePaneTemplateChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorablePaneTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- #endregion AnchorablePaneTemplate
-
- #region AnchorSideTemplate
-
- /// The dependency property.
- public static readonly DependencyProperty AnchorSideTemplateProperty = DependencyProperty.Register(nameof(AnchorSideTemplate), typeof(ControlTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata((ControlTemplate)null));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates ....
- ///
- public ControlTemplate AnchorSideTemplate
- {
- get => (ControlTemplate)GetValue(AnchorSideTemplateProperty);
- set => SetValue(AnchorSideTemplateProperty, value);
- }
-
- #endregion AnchorSideTemplate
-
- #region AnchorGroupTemplate
-
- /// dependency property.
- public static readonly DependencyProperty AnchorGroupTemplateProperty = DependencyProperty.Register(nameof(AnchorGroupTemplate), typeof(ControlTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata((ControlTemplate)null));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the template used to render the AnchorGroup control.
- ///
- public ControlTemplate AnchorGroupTemplate
- {
- get => (ControlTemplate)GetValue(AnchorGroupTemplateProperty);
- set => SetValue(AnchorGroupTemplateProperty, value);
- }
-
- #endregion AnchorGroupTemplate
-
- #region AnchorTemplate
-
- /// dependency property.
- public static readonly DependencyProperty AnchorTemplateProperty = DependencyProperty.Register(nameof(AnchorTemplate), typeof(ControlTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata((ControlTemplate)null));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates ....
- ///
- public ControlTemplate AnchorTemplate
- {
- get => (ControlTemplate)GetValue(AnchorTemplateProperty);
- set => SetValue(AnchorTemplateProperty, value);
- }
-
- #endregion AnchorTemplate
-
- #region DocumentPaneControlStyle
-
- /// dependency property.
- public static readonly DependencyProperty DocumentPaneControlStyleProperty = DependencyProperty.Register(nameof(DocumentPaneControlStyle), typeof(Style), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnDocumentPaneControlStyleChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates ....
- ///
- public Style DocumentPaneControlStyle
- {
- get => (Style)GetValue(DocumentPaneControlStyleProperty);
- set => SetValue(DocumentPaneControlStyleProperty, value);
- }
-
- /// Handles changes to the DocumentPaneControlStyle property.
- private static void OnDocumentPaneControlStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentPaneControlStyleChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentPaneControlStyleChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- #endregion DocumentPaneControlStyle
-
- #region AnchorablePaneControlStyle
-
- /// dependency property.
- public static readonly DependencyProperty AnchorablePaneControlStyleProperty = DependencyProperty.Register(nameof(AnchorablePaneControlStyle), typeof(Style), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnAnchorablePaneControlStyleChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the style to apply to AnchorablePaneControl.
- ///
- public Style AnchorablePaneControlStyle
- {
- get => (Style)GetValue(AnchorablePaneControlStyleProperty);
- set => SetValue(AnchorablePaneControlStyleProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorablePaneControlStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorablePaneControlStyleChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorablePaneControlStyleChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- #endregion AnchorablePaneControlStyle
-
- #region DocumentHeaderTemplate
-
- /// dependency property.
- public static readonly DependencyProperty DocumentHeaderTemplateProperty = DependencyProperty.Register(nameof(DocumentHeaderTemplate), typeof(DataTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata((DataTemplate)null, OnDocumentHeaderTemplateChanged, CoerceDocumentHeaderTemplateValue));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates data template to use for document header.
- ///
- public DataTemplate DocumentHeaderTemplate
- {
- get => (DataTemplate)GetValue(DocumentHeaderTemplateProperty);
- set => SetValue(DocumentHeaderTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnDocumentHeaderTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentHeaderTemplateChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentHeaderTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- /// Coerces the value.
- private static object CoerceDocumentHeaderTemplateValue(DependencyObject d, object value)
- {
- if (value != null && d.GetValue(DocumentHeaderTemplateSelectorProperty) != null)
- return null;
- return value;
- }
-
- #endregion DocumentHeaderTemplate
-
- #region DocumentHeaderTemplateSelector
-
- /// dependency property.
- public static readonly DependencyProperty DocumentHeaderTemplateSelectorProperty = DependencyProperty.Register(nameof(DocumentHeaderTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnDocumentHeaderTemplateSelectorChanged, CoerceDocumentHeaderTemplateSelectorValue));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the template selector that is used when selecting the data template for the header.
- ///
- public DataTemplateSelector DocumentHeaderTemplateSelector
- {
- get => (DataTemplateSelector)GetValue(DocumentHeaderTemplateSelectorProperty);
- set => SetValue(DocumentHeaderTemplateSelectorProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnDocumentHeaderTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentHeaderTemplateSelectorChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentHeaderTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.NewValue != null && DocumentHeaderTemplate != null)
- DocumentHeaderTemplate = null;
- if (DocumentPaneMenuItemHeaderTemplateSelector == null)
- DocumentPaneMenuItemHeaderTemplateSelector = DocumentHeaderTemplateSelector;
- }
-
- /// Coerces the value.
- private static object CoerceDocumentHeaderTemplateSelectorValue(DependencyObject d, object value) => value;
-
- #endregion DocumentHeaderTemplateSelector
-
- #region DocumentTitleTemplate
-
- /// dependency property.
- public static readonly DependencyProperty DocumentTitleTemplateProperty = DependencyProperty.Register(nameof(DocumentTitleTemplate), typeof(DataTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnDocumentTitleTemplateChanged, CoerceDocumentTitleTemplateValue));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the data template to use when creating the title for a document.
- ///
- public DataTemplate DocumentTitleTemplate
- {
- get => (DataTemplate)GetValue(DocumentTitleTemplateProperty);
- set => SetValue(DocumentTitleTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnDocumentTitleTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentTitleTemplateChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentTitleTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- /// Coerces the value.
- private static object CoerceDocumentTitleTemplateValue(DependencyObject d, object value)
- {
- if (value != null && d.GetValue(DocumentTitleTemplateSelectorProperty) != null)
- return null;
- return value;
- }
-
- #endregion DocumentTitleTemplate
-
- #region DocumentTitleTemplateSelector
-
- /// dependency property.
- public static readonly DependencyProperty DocumentTitleTemplateSelectorProperty = DependencyProperty.Register(nameof(DocumentTitleTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnDocumentTitleTemplateSelectorChanged, CoerceDocumentTitleTemplateSelectorValue));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the data template selector to use when creating the data template for the title.
- ///
- public DataTemplateSelector DocumentTitleTemplateSelector
- {
- get => (DataTemplateSelector)GetValue(DocumentTitleTemplateSelectorProperty);
- set => SetValue(DocumentTitleTemplateSelectorProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnDocumentTitleTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentTitleTemplateSelectorChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnDocumentTitleTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.NewValue != null)
- DocumentTitleTemplate = null;
- }
-
- /// Coerces the value.
- private static object CoerceDocumentTitleTemplateSelectorValue(DependencyObject d, object value) => value;
-
- #endregion DocumentTitleTemplateSelector
-
- #region AnchorableTitleTemplate
-
- /// dependency property.
- public static readonly DependencyProperty AnchorableTitleTemplateProperty = DependencyProperty.Register(nameof(AnchorableTitleTemplate), typeof(DataTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata((DataTemplate)null, OnAnchorableTitleTemplateChanged, CoerceAnchorableTitleTemplateValue));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the data template to use for anchorables title.
- ///
- public DataTemplate AnchorableTitleTemplate
- {
- get => (DataTemplate)GetValue(AnchorableTitleTemplateProperty);
- set => SetValue(AnchorableTitleTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorableTitleTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableTitleTemplateChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorableTitleTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- /// Coerces the value.
- private static object CoerceAnchorableTitleTemplateValue(DependencyObject d, object value)
- {
- if (value != null && d.GetValue(AnchorableTitleTemplateSelectorProperty) != null)
- return null;
- return value;
- }
-
- #endregion AnchorableTitleTemplate
-
- #region AnchorableTitleTemplateSelector
-
- /// dependency property.
- public static readonly DependencyProperty AnchorableTitleTemplateSelectorProperty = DependencyProperty.Register(nameof(AnchorableTitleTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnAnchorableTitleTemplateSelectorChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates which selector to use when selecting data template for the title of anchorables.
- ///
- public DataTemplateSelector AnchorableTitleTemplateSelector
- {
- get => (DataTemplateSelector)GetValue(AnchorableTitleTemplateSelectorProperty);
- set => SetValue(AnchorableTitleTemplateSelectorProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorableTitleTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableTitleTemplateSelectorChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorableTitleTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.NewValue != null && AnchorableTitleTemplate != null)
- AnchorableTitleTemplate = null;
- }
-
- #endregion AnchorableTitleTemplateSelector
-
- #region AnchorableHeaderTemplate
-
- /// dependency property.
- public static readonly DependencyProperty AnchorableHeaderTemplateProperty = DependencyProperty.Register(nameof(AnchorableHeaderTemplate), typeof(DataTemplate), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnAnchorableHeaderTemplateChanged, CoerceAnchorableHeaderTemplateValue));
-
- /// Gets or sets the property. This dependency property indicates the data template to use for anchorable templates.
- public DataTemplate AnchorableHeaderTemplate
- {
- get => (DataTemplate)GetValue(AnchorableHeaderTemplateProperty);
- set => SetValue(AnchorableHeaderTemplateProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorableHeaderTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableHeaderTemplateChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorableHeaderTemplateChanged(DependencyPropertyChangedEventArgs e)
- {
- }
-
- /// Coerces the value.
- private static object CoerceAnchorableHeaderTemplateValue(DependencyObject d, object value)
- {
- if (value != null && d.GetValue(AnchorableHeaderTemplateSelectorProperty) != null)
- return null;
- return value;
- }
-
- #endregion AnchorableHeaderTemplate
-
- #region AnchorableHeaderTemplateSelector
-
- /// dependency property.
- public static readonly DependencyProperty AnchorableHeaderTemplateSelectorProperty = DependencyProperty.Register(nameof(AnchorableHeaderTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
- new FrameworkPropertyMetadata((DataTemplateSelector)null, OnAnchorableHeaderTemplateSelectorChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the selector to use when selecting the data template for anchorable headers.
- ///
- public DataTemplateSelector AnchorableHeaderTemplateSelector
- {
- get => (DataTemplateSelector)GetValue(AnchorableHeaderTemplateSelectorProperty);
- set => SetValue(AnchorableHeaderTemplateSelectorProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnAnchorableHeaderTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableHeaderTemplateSelectorChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnAnchorableHeaderTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.NewValue != null)
- AnchorableHeaderTemplate = null;
- }
-
- #endregion AnchorableHeaderTemplateSelector
-
- #region LayoutRootPanel
-
- /// dependency property.
- public static readonly DependencyProperty LayoutRootPanelProperty = DependencyProperty.Register(nameof(LayoutRootPanel), typeof(LayoutPanelControl), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnLayoutRootPanelChanged));
-
- ///
- /// Gets or sets the property. This dependency property
- /// indicates the layout panel control which is attached to the Layout.Root property.
- ///
- public LayoutPanelControl LayoutRootPanel
- {
- get => (LayoutPanelControl)GetValue(LayoutRootPanelProperty);
- set => SetValue(LayoutRootPanelProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnLayoutRootPanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLayoutRootPanelChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnLayoutRootPanelChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.OldValue != null)
- InternalRemoveLogicalChild(e.OldValue);
- if (e.NewValue != null)
- InternalAddLogicalChild(e.NewValue);
- }
-
- #endregion LayoutRootPanel
-
- #region RightSidePanel
-
- /// dependency property.
- public static readonly DependencyProperty RightSidePanelProperty = DependencyProperty.Register(nameof(RightSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnRightSidePanelChanged));
-
- /// Gets or sets the property. This dependency property indicates right side anchor panel.
- public LayoutAnchorSideControl RightSidePanel
- {
- get => (LayoutAnchorSideControl)GetValue(RightSidePanelProperty);
- set => SetValue(RightSidePanelProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnRightSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnRightSidePanelChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnRightSidePanelChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.OldValue != null)
- InternalRemoveLogicalChild(e.OldValue);
- if (e.NewValue != null)
- InternalAddLogicalChild(e.NewValue);
- }
-
- #endregion RightSidePanel
-
- #region LeftSidePanel
-
- /// dependency property.
- public static readonly DependencyProperty LeftSidePanelProperty = DependencyProperty.Register(nameof(LeftSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnLeftSidePanelChanged));
-
- /// Gets or sets the property. This dependency property indicates the left side panel control.
- public LayoutAnchorSideControl LeftSidePanel
- {
- get => (LayoutAnchorSideControl)GetValue(LeftSidePanelProperty);
- set => SetValue(LeftSidePanelProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnLeftSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLeftSidePanelChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnLeftSidePanelChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.OldValue != null)
- InternalRemoveLogicalChild(e.OldValue);
- if (e.NewValue != null)
- InternalAddLogicalChild(e.NewValue);
- }
-
- #endregion LeftSidePanel
-
- #region TopSidePanel
-
- /// dependency property.
- public static readonly DependencyProperty TopSidePanelProperty = DependencyProperty.Register(nameof(TopSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnTopSidePanelChanged));
-
- /// Gets or sets the property. This dependency property indicates top side control panel.
- public LayoutAnchorSideControl TopSidePanel
- {
- get => (LayoutAnchorSideControl)GetValue(TopSidePanelProperty);
- set => SetValue(TopSidePanelProperty, value);
- }
-
- /// Handles changes to the property.
- private static void OnTopSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnTopSidePanelChanged(e);
-
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnTopSidePanelChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.OldValue != null)
- InternalRemoveLogicalChild(e.OldValue);
- if (e.NewValue != null)
- InternalAddLogicalChild(e.NewValue);
- }
-
- #endregion TopSidePanel
-
- #region BottomSidePanel
-
- /// dependency property.
- public static readonly DependencyProperty BottomSidePanelProperty = DependencyProperty.Register(nameof(BottomSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
- new FrameworkPropertyMetadata(null, OnBottomSidePanelChanged));
-
- /// Gets or sets the property. This dependency property indicates bottom side panel control.
- public LayoutAnchorSideControl BottomSidePanel
- {
- get => (LayoutAnchorSideControl)GetValue(BottomSidePanelProperty);
- set => SetValue(BottomSidePanelProperty, value);
- }
+ #region Events
+
+ /// Event fired when property changes.
+ ///
+ public event EventHandler LayoutChanged;
+
+ /// Event fired when property is about to be changed.
+ ///
+ public event EventHandler LayoutChanging;
+
+ /// Event fired when a document is about to be closed.
+ /// Subscribers have the opportunity to cancel the operation.
+ public event EventHandler DocumentClosing;
+
+ /// Event fired after a document is closed.
+ public event EventHandler DocumentClosed;
+
+ /// Event is raised when changes.
+ ///
+ public event EventHandler ActiveContentChanged;
+
+ #endregion Events
+
+ #region Public Properties
+
+ #region Layout
+
+ /// dependency property.
+ public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(nameof(Layout), typeof(LayoutRoot), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnLayoutChanged, CoerceLayoutValue));
+
+ /// Gets or sets the property. This dependency property indicates layout tree.
+ public LayoutRoot Layout
+ {
+ get => (LayoutRoot)GetValue(LayoutProperty);
+ set => SetValue(LayoutProperty, value);
+ }
+
+ /// Coerces the value.
+ private static object CoerceLayoutValue(DependencyObject d, object value)
+ {
+ if (value == null) return new LayoutRoot { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
+ ((DockingManager)d).OnLayoutChanging(value as LayoutRoot);
+ return value;
+ }
+
+ /// Handles changes to the property.
+ private static void OnLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLayoutChanged(e.OldValue as LayoutRoot, e.NewValue as LayoutRoot);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayout)
+ {
+ if (oldLayout != null)
+ {
+ oldLayout.PropertyChanged -= OnLayoutRootPropertyChanged;
+ oldLayout.Updated -= OnLayoutRootUpdated;
+ }
+
+ foreach (var fwc in _fwList.ToArray())
+ {
+ fwc.KeepContentVisibleOnClose = true;
+ fwc.InternalClose();
+ }
+
+ _fwList.Clear();
+
+ foreach (var fwc in _fwHiddenList.ToArray())
+ {
+ fwc.InternalClose();
+ }
+
+ _fwHiddenList.Clear();
+ DetachDocumentsSource(oldLayout, DocumentsSource);
+ DetachAnchorablesSource(oldLayout, AnchorablesSource);
+
+ if (oldLayout != null && oldLayout.Manager == this)
+ oldLayout.Manager = null;
+
+ ClearLogicalChildrenList();
+ DetachLayoutItems();
+
+ Layout.Manager = this;
+
+ AttachLayoutItems();
+ AttachDocumentsSource(newLayout, DocumentsSource);
+ AttachAnchorablesSource(newLayout, AnchorablesSource);
+
+ if (IsLoaded)
+ {
+ LayoutRootPanel = CreateUIElementForModel(Layout.RootPanel) as LayoutPanelControl;
+ LeftSidePanel = CreateUIElementForModel(Layout.LeftSide) as LayoutAnchorSideControl;
+ TopSidePanel = CreateUIElementForModel(Layout.TopSide) as LayoutAnchorSideControl;
+ RightSidePanel = CreateUIElementForModel(Layout.RightSide) as LayoutAnchorSideControl;
+ BottomSidePanel = CreateUIElementForModel(Layout.BottomSide) as LayoutAnchorSideControl;
+
+ foreach (var fw in Layout.FloatingWindows.ToArray())
+ if (fw.IsValid)
+ _fwList.Add(CreateUIElementForModel(fw) as LayoutFloatingWindowControl);
+
+ foreach (var fw in _fwList.ToArray())
+ {
+ if (fw.Model is LayoutAnchorableFloatingWindow window && window.RootPanel.IsMaximized)
+ {
+ fw.WindowState = WindowState.Normal;
+ fw.Show();
+ fw.WindowState = WindowState.Maximized;
+ }
+ else
+ {
+ if (fw.Content != null || (fw.Model as LayoutAnchorableFloatingWindow)?.IsVisible == true)
+ fw.Show();
+ else
+ fw.Hide();
+ }
+
+ //fw.Owner = Window.GetWindow(this);
+ //fw.SetParentToMainWindowOf(this);
+ }
+
+ // In order to prevent resource leaks, unsubscribe from SizeChanged event for case when user call loading of Layout Settigns.
+ SizeChanged -= OnSizeChanged;
+ SizeChanged += OnSizeChanged;
+ }
+
+ if (newLayout != null)
+ {
+ newLayout.PropertyChanged += OnLayoutRootPropertyChanged;
+ newLayout.Updated += OnLayoutRootUpdated;
+ }
+
+ LayoutChanged?.Invoke(this, EventArgs.Empty);
+ // Layout?.CollectGarbage();
+ CommandManager.InvalidateRequerySuggested();
+ }
+
+ #endregion Layout
+
+ #region LayoutUpdateStrategy
+
+ /// dependency property.
+ public static readonly DependencyProperty LayoutUpdateStrategyProperty = DependencyProperty.Register(nameof(LayoutUpdateStrategy), typeof(ILayoutUpdateStrategy), typeof(DockingManager),
+ new FrameworkPropertyMetadata((ILayoutUpdateStrategy)null));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the strategy class to call when AvalonDock needs to positionate a LayoutAnchorable inside an existing layout.
+ ///
+ /// Sometimes it's impossible to automatically insert an anchorable in the layout without specifing the target parent pane.
+ /// Set this property to an object that will be asked to insert the anchorable to the desidered position.
+ public ILayoutUpdateStrategy LayoutUpdateStrategy
+ {
+ get => (ILayoutUpdateStrategy)GetValue(LayoutUpdateStrategyProperty);
+ set => SetValue(LayoutUpdateStrategyProperty, value);
+ }
+
+ #endregion LayoutUpdateStrategy
+
+ #region DocumentPaneTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentPaneTemplateProperty = DependencyProperty.Register(nameof(DocumentPaneTemplate), typeof(ControlTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnDocumentPaneTemplateChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates .
+ ///
+ public ControlTemplate DocumentPaneTemplate
+ {
+ get => (ControlTemplate)GetValue(DocumentPaneTemplateProperty);
+ set => SetValue(DocumentPaneTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnDocumentPaneTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ ((DockingManager)d).OnDocumentPaneTemplateChanged(e);
+ }
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentPaneTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ #endregion DocumentPaneTemplate
+
+ #region AnchorablePaneTemplate
+
+ ///
+ /// dependency property
+ ///
+ public static readonly DependencyProperty AnchorablePaneTemplateProperty = DependencyProperty.Register(nameof(AnchorablePaneTemplate), typeof(ControlTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnAnchorablePaneTemplateChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates ....
+ ///
+ public ControlTemplate AnchorablePaneTemplate
+ {
+ get => (ControlTemplate)GetValue(AnchorablePaneTemplateProperty);
+ set => SetValue(AnchorablePaneTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorablePaneTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorablePaneTemplateChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorablePaneTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ #endregion AnchorablePaneTemplate
+
+ #region AnchorSideTemplate
+
+ /// The dependency property.
+ public static readonly DependencyProperty AnchorSideTemplateProperty = DependencyProperty.Register(nameof(AnchorSideTemplate), typeof(ControlTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata((ControlTemplate)null));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates ....
+ ///
+ public ControlTemplate AnchorSideTemplate
+ {
+ get => (ControlTemplate)GetValue(AnchorSideTemplateProperty);
+ set => SetValue(AnchorSideTemplateProperty, value);
+ }
+
+ #endregion AnchorSideTemplate
+
+ #region AnchorGroupTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorGroupTemplateProperty = DependencyProperty.Register(nameof(AnchorGroupTemplate), typeof(ControlTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata((ControlTemplate)null));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the template used to render the AnchorGroup control.
+ ///
+ public ControlTemplate AnchorGroupTemplate
+ {
+ get => (ControlTemplate)GetValue(AnchorGroupTemplateProperty);
+ set => SetValue(AnchorGroupTemplateProperty, value);
+ }
+
+ #endregion AnchorGroupTemplate
+
+ #region AnchorTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorTemplateProperty = DependencyProperty.Register(nameof(AnchorTemplate), typeof(ControlTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata((ControlTemplate)null));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates ....
+ ///
+ public ControlTemplate AnchorTemplate
+ {
+ get => (ControlTemplate)GetValue(AnchorTemplateProperty);
+ set => SetValue(AnchorTemplateProperty, value);
+ }
+
+ #endregion AnchorTemplate
+
+ #region DocumentPaneControlStyle
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentPaneControlStyleProperty = DependencyProperty.Register(nameof(DocumentPaneControlStyle), typeof(Style), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnDocumentPaneControlStyleChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates ....
+ ///
+ public Style DocumentPaneControlStyle
+ {
+ get => (Style)GetValue(DocumentPaneControlStyleProperty);
+ set => SetValue(DocumentPaneControlStyleProperty, value);
+ }
+
+ /// Handles changes to the DocumentPaneControlStyle property.
+ private static void OnDocumentPaneControlStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentPaneControlStyleChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentPaneControlStyleChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ #endregion DocumentPaneControlStyle
+
+ #region AnchorablePaneControlStyle
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorablePaneControlStyleProperty = DependencyProperty.Register(nameof(AnchorablePaneControlStyle), typeof(Style), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnAnchorablePaneControlStyleChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the style to apply to AnchorablePaneControl.
+ ///
+ public Style AnchorablePaneControlStyle
+ {
+ get => (Style)GetValue(AnchorablePaneControlStyleProperty);
+ set => SetValue(AnchorablePaneControlStyleProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorablePaneControlStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorablePaneControlStyleChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorablePaneControlStyleChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ #endregion AnchorablePaneControlStyle
+
+ #region DocumentHeaderTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentHeaderTemplateProperty = DependencyProperty.Register(nameof(DocumentHeaderTemplate), typeof(DataTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata((DataTemplate)null, OnDocumentHeaderTemplateChanged, CoerceDocumentHeaderTemplateValue));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates data template to use for document header.
+ ///
+ public DataTemplate DocumentHeaderTemplate
+ {
+ get => (DataTemplate)GetValue(DocumentHeaderTemplateProperty);
+ set => SetValue(DocumentHeaderTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnDocumentHeaderTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentHeaderTemplateChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentHeaderTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ /// Coerces the value.
+ private static object CoerceDocumentHeaderTemplateValue(DependencyObject d, object value)
+ {
+ if (value != null && d.GetValue(DocumentHeaderTemplateSelectorProperty) != null)
+ return null;
+ return value;
+ }
+
+ #endregion DocumentHeaderTemplate
+
+ #region DocumentHeaderTemplateSelector
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentHeaderTemplateSelectorProperty = DependencyProperty.Register(nameof(DocumentHeaderTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnDocumentHeaderTemplateSelectorChanged, CoerceDocumentHeaderTemplateSelectorValue));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the template selector that is used when selecting the data template for the header.
+ ///
+ public DataTemplateSelector DocumentHeaderTemplateSelector
+ {
+ get => (DataTemplateSelector)GetValue(DocumentHeaderTemplateSelectorProperty);
+ set => SetValue(DocumentHeaderTemplateSelectorProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnDocumentHeaderTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentHeaderTemplateSelectorChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentHeaderTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.NewValue != null && DocumentHeaderTemplate != null)
+ DocumentHeaderTemplate = null;
+ if (DocumentPaneMenuItemHeaderTemplateSelector == null)
+ DocumentPaneMenuItemHeaderTemplateSelector = DocumentHeaderTemplateSelector;
+ }
+
+ /// Coerces the value.
+ private static object CoerceDocumentHeaderTemplateSelectorValue(DependencyObject d, object value) => value;
+
+ #endregion DocumentHeaderTemplateSelector
+
+ #region DocumentTitleTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentTitleTemplateProperty = DependencyProperty.Register(nameof(DocumentTitleTemplate), typeof(DataTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnDocumentTitleTemplateChanged, CoerceDocumentTitleTemplateValue));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the data template to use when creating the title for a document.
+ ///
+ public DataTemplate DocumentTitleTemplate
+ {
+ get => (DataTemplate)GetValue(DocumentTitleTemplateProperty);
+ set => SetValue(DocumentTitleTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnDocumentTitleTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentTitleTemplateChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentTitleTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ /// Coerces the value.
+ private static object CoerceDocumentTitleTemplateValue(DependencyObject d, object value)
+ {
+ if (value != null && d.GetValue(DocumentTitleTemplateSelectorProperty) != null)
+ return null;
+ return value;
+ }
+
+ #endregion DocumentTitleTemplate
+
+ #region DocumentTitleTemplateSelector
+
+ /// dependency property.
+ public static readonly DependencyProperty DocumentTitleTemplateSelectorProperty = DependencyProperty.Register(nameof(DocumentTitleTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnDocumentTitleTemplateSelectorChanged, CoerceDocumentTitleTemplateSelectorValue));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the data template selector to use when creating the data template for the title.
+ ///
+ public DataTemplateSelector DocumentTitleTemplateSelector
+ {
+ get => (DataTemplateSelector)GetValue(DocumentTitleTemplateSelectorProperty);
+ set => SetValue(DocumentTitleTemplateSelectorProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnDocumentTitleTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnDocumentTitleTemplateSelectorChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnDocumentTitleTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.NewValue != null)
+ DocumentTitleTemplate = null;
+ }
+
+ /// Coerces the value.
+ private static object CoerceDocumentTitleTemplateSelectorValue(DependencyObject d, object value) => value;
+
+ #endregion DocumentTitleTemplateSelector
+
+ #region AnchorableTitleTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorableTitleTemplateProperty = DependencyProperty.Register(nameof(AnchorableTitleTemplate), typeof(DataTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata((DataTemplate)null, OnAnchorableTitleTemplateChanged, CoerceAnchorableTitleTemplateValue));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the data template to use for anchorables title.
+ ///
+ public DataTemplate AnchorableTitleTemplate
+ {
+ get => (DataTemplate)GetValue(AnchorableTitleTemplateProperty);
+ set => SetValue(AnchorableTitleTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorableTitleTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableTitleTemplateChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorableTitleTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ /// Coerces the value.
+ private static object CoerceAnchorableTitleTemplateValue(DependencyObject d, object value)
+ {
+ if (value != null && d.GetValue(AnchorableTitleTemplateSelectorProperty) != null)
+ return null;
+ return value;
+ }
+
+ #endregion AnchorableTitleTemplate
+
+ #region AnchorableTitleTemplateSelector
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorableTitleTemplateSelectorProperty = DependencyProperty.Register(nameof(AnchorableTitleTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnAnchorableTitleTemplateSelectorChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates which selector to use when selecting data template for the title of anchorables.
+ ///
+ public DataTemplateSelector AnchorableTitleTemplateSelector
+ {
+ get => (DataTemplateSelector)GetValue(AnchorableTitleTemplateSelectorProperty);
+ set => SetValue(AnchorableTitleTemplateSelectorProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorableTitleTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableTitleTemplateSelectorChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorableTitleTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.NewValue != null && AnchorableTitleTemplate != null)
+ AnchorableTitleTemplate = null;
+ }
+
+ #endregion AnchorableTitleTemplateSelector
+
+ #region AnchorableHeaderTemplate
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorableHeaderTemplateProperty = DependencyProperty.Register(nameof(AnchorableHeaderTemplate), typeof(DataTemplate), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnAnchorableHeaderTemplateChanged, CoerceAnchorableHeaderTemplateValue));
+
+ /// Gets or sets the property. This dependency property indicates the data template to use for anchorable templates.
+ public DataTemplate AnchorableHeaderTemplate
+ {
+ get => (DataTemplate)GetValue(AnchorableHeaderTemplateProperty);
+ set => SetValue(AnchorableHeaderTemplateProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorableHeaderTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableHeaderTemplateChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorableHeaderTemplateChanged(DependencyPropertyChangedEventArgs e)
+ {
+ }
+
+ /// Coerces the value.
+ private static object CoerceAnchorableHeaderTemplateValue(DependencyObject d, object value)
+ {
+ if (value != null && d.GetValue(AnchorableHeaderTemplateSelectorProperty) != null)
+ return null;
+ return value;
+ }
+
+ #endregion AnchorableHeaderTemplate
+
+ #region AnchorableHeaderTemplateSelector
+
+ /// dependency property.
+ public static readonly DependencyProperty AnchorableHeaderTemplateSelectorProperty = DependencyProperty.Register(nameof(AnchorableHeaderTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager),
+ new FrameworkPropertyMetadata((DataTemplateSelector)null, OnAnchorableHeaderTemplateSelectorChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the selector to use when selecting the data template for anchorable headers.
+ ///
+ public DataTemplateSelector AnchorableHeaderTemplateSelector
+ {
+ get => (DataTemplateSelector)GetValue(AnchorableHeaderTemplateSelectorProperty);
+ set => SetValue(AnchorableHeaderTemplateSelectorProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnAnchorableHeaderTemplateSelectorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnAnchorableHeaderTemplateSelectorChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnAnchorableHeaderTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.NewValue != null)
+ AnchorableHeaderTemplate = null;
+ }
+
+ #endregion AnchorableHeaderTemplateSelector
+
+ #region LayoutRootPanel
+
+ /// dependency property.
+ public static readonly DependencyProperty LayoutRootPanelProperty = DependencyProperty.Register(nameof(LayoutRootPanel), typeof(LayoutPanelControl), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnLayoutRootPanelChanged));
+
+ ///
+ /// Gets or sets the property. This dependency property
+ /// indicates the layout panel control which is attached to the Layout.Root property.
+ ///
+ public LayoutPanelControl LayoutRootPanel
+ {
+ get => (LayoutPanelControl)GetValue(LayoutRootPanelProperty);
+ set => SetValue(LayoutRootPanelProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnLayoutRootPanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLayoutRootPanelChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnLayoutRootPanelChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ InternalRemoveLogicalChild(e.OldValue);
+ if (e.NewValue != null)
+ InternalAddLogicalChild(e.NewValue);
+ }
+
+ #endregion LayoutRootPanel
+
+ #region RightSidePanel
+
+ /// dependency property.
+ public static readonly DependencyProperty RightSidePanelProperty = DependencyProperty.Register(nameof(RightSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnRightSidePanelChanged));
+
+ /// Gets or sets the property. This dependency property indicates right side anchor panel.
+ public LayoutAnchorSideControl RightSidePanel
+ {
+ get => (LayoutAnchorSideControl)GetValue(RightSidePanelProperty);
+ set => SetValue(RightSidePanelProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnRightSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnRightSidePanelChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnRightSidePanelChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ InternalRemoveLogicalChild(e.OldValue);
+ if (e.NewValue != null)
+ InternalAddLogicalChild(e.NewValue);
+ }
+
+ #endregion RightSidePanel
+
+ #region LeftSidePanel
+
+ /// dependency property.
+ public static readonly DependencyProperty LeftSidePanelProperty = DependencyProperty.Register(nameof(LeftSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnLeftSidePanelChanged));
+
+ /// Gets or sets the property. This dependency property indicates the left side panel control.
+ public LayoutAnchorSideControl LeftSidePanel
+ {
+ get => (LayoutAnchorSideControl)GetValue(LeftSidePanelProperty);
+ set => SetValue(LeftSidePanelProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnLeftSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnLeftSidePanelChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnLeftSidePanelChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ InternalRemoveLogicalChild(e.OldValue);
+ if (e.NewValue != null)
+ InternalAddLogicalChild(e.NewValue);
+ }
+
+ #endregion LeftSidePanel
+
+ #region TopSidePanel
+
+ /// dependency property.
+ public static readonly DependencyProperty TopSidePanelProperty = DependencyProperty.Register(nameof(TopSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnTopSidePanelChanged));
+
+ /// Gets or sets the property. This dependency property indicates top side control panel.
+ public LayoutAnchorSideControl TopSidePanel
+ {
+ get => (LayoutAnchorSideControl)GetValue(TopSidePanelProperty);
+ set => SetValue(TopSidePanelProperty, value);
+ }
+
+ /// Handles changes to the property.
+ private static void OnTopSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnTopSidePanelChanged(e);
+
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnTopSidePanelChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ InternalRemoveLogicalChild(e.OldValue);
+ if (e.NewValue != null)
+ InternalAddLogicalChild(e.NewValue);
+ }
+
+ #endregion TopSidePanel
+
+ #region BottomSidePanel
+
+ /// dependency property.
+ public static readonly DependencyProperty BottomSidePanelProperty = DependencyProperty.Register(nameof(BottomSidePanel), typeof(LayoutAnchorSideControl), typeof(DockingManager),
+ new FrameworkPropertyMetadata(null, OnBottomSidePanelChanged));
+
+ /// Gets or sets the property. This dependency property indicates bottom side panel control.
+ public LayoutAnchorSideControl BottomSidePanel
+ {
+ get => (LayoutAnchorSideControl)GetValue(BottomSidePanelProperty);
+ set => SetValue(BottomSidePanelProperty, value);
+ }
- /// Handles changes to the property.
- private static void OnBottomSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnBottomSidePanelChanged(e);
+ /// Handles changes to the property.
+ private static void OnBottomSidePanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((DockingManager)d).OnBottomSidePanelChanged(e);
- /// Provides derived classes an opportunity to handle changes to the property.
- protected virtual void OnBottomSidePanelChanged(DependencyPropertyChangedEventArgs e)
- {
- if (e.OldValue != null)
- InternalRemoveLogicalChild(e.OldValue);
- if (e.NewValue != null)
- InternalAddLogicalChild(e.NewValue);
- }
+ /// Provides derived classes an opportunity to handle changes to the property.
+ protected virtual void OnBottomSidePanelChanged(DependencyPropertyChangedEventArgs e)
+ {
+ if (e.OldValue != null)
+ InternalRemoveLogicalChild(e.OldValue);
+ if (e.NewValue != null)
+ InternalAddLogicalChild(e.NewValue);
+ }
- #endregion BottomSidePanel
-
- #region LogicalChildren
+ #endregion BottomSidePanel
+
+ #region LogicalChildren
- List _logicalChildren = new List();
+ List _logicalChildren = new List();
- ///
- protected override IEnumerator LogicalChildren => _logicalChildren.Select(ch => ch.GetValueOrDefault