From 1a796e51581e0ebecc273396a6d0bfb1e66da932 Mon Sep 17 00:00:00 2001 From: Dirkster99 Date: Tue, 7 Jul 2020 23:20:58 +0200 Subject: [PATCH] #179 Added Bindable property attributes for DockingManager class --- .../Components/AvalonDock/DockingManager.cs | 279 ++++++++---------- 1 file changed, 129 insertions(+), 150 deletions(-) diff --git a/source/Components/AvalonDock/DockingManager.cs b/source/Components/AvalonDock/DockingManager.cs index 7d72eff0..e77bd336 100644 --- a/source/Components/AvalonDock/DockingManager.cs +++ b/source/Components/AvalonDock/DockingManager.cs @@ -125,7 +125,8 @@ public DockingManager() 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. + /// Gets/sets the layout root of the layout tree managed in this framework. + [Bindable(true), Description("Gets/sets the layout root of the layout tree managed in this framework."), Category("Layout")] public LayoutRoot Layout { get => (LayoutRoot)GetValue(LayoutProperty); @@ -238,11 +239,11 @@ protected virtual void OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayou 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. + /// Gets/sets the layout strategy class that can be to called by the framework when it needs to position a 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. + [Bindable(true), Description("Gets/sets the layout strategy class that can be to called by the framework when it needs to position a LayoutAnchorable inside an existing layout."), Category("Layout")] public ILayoutUpdateStrategy LayoutUpdateStrategy { get => (ILayoutUpdateStrategy)GetValue(LayoutUpdateStrategyProperty); @@ -257,10 +258,8 @@ public ILayoutUpdateStrategy LayoutUpdateStrategy 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 . - /// + /// Gets/sets the that can be used to render the . + [Bindable(true), Description("Gets/sets the ControlTemplate´that can be used to render the LayoutDocumentPaneControl."), Category("Document")] public ControlTemplate DocumentPaneTemplate { get => (ControlTemplate)GetValue(DocumentPaneTemplateProperty); @@ -288,10 +287,8 @@ protected virtual void OnDocumentPaneTemplateChanged(DependencyPropertyChangedEv 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 .... - /// + /// Gets/sets the used to render . + [Bindable(true), Description("Gets/sets the ControlTemplate used to render LayoutAnchorablePaneControl"), Category("Anchorable")] public ControlTemplate AnchorablePaneTemplate { get => (ControlTemplate)GetValue(AnchorablePaneTemplateProperty); @@ -314,10 +311,8 @@ protected virtual void OnAnchorablePaneTemplateChanged(DependencyPropertyChanged 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 .... - /// + /// Gets/sets the used to render . + [Bindable(true), Description("Gets/sets the ControlTemplate used to render LayoutAnchorSideControl."), Category("Anchor")] public ControlTemplate AnchorSideTemplate { get => (ControlTemplate)GetValue(AnchorSideTemplateProperty); @@ -332,10 +327,8 @@ public ControlTemplate AnchorSideTemplate 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. - /// + /// Gets/sets the used to render the . + [Bindable(true), Description("Gets/sets the ControlTemplate used to render LayoutAnchorGroupControl."), Category("Anchor")] public ControlTemplate AnchorGroupTemplate { get => (ControlTemplate)GetValue(AnchorGroupTemplateProperty); @@ -350,10 +343,8 @@ public ControlTemplate AnchorGroupTemplate 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 .... - /// + /// Gets/sets the used to render a . + [Bindable(true), Description("Gets/sets the ControlTemplate used to render a LayoutAnchorControl."), Category("Anchor")] public ControlTemplate AnchorTemplate { get => (ControlTemplate)GetValue(AnchorTemplateProperty); @@ -368,10 +359,8 @@ public ControlTemplate AnchorTemplate 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 .... - /// + /// Gets/sets the style of a . + [Bindable(true), Description("Gets/sets the style of a LayoutDocumentPaneControl."), Category("Document")] public Style DocumentPaneControlStyle { get => (Style)GetValue(DocumentPaneControlStyleProperty); @@ -394,10 +383,8 @@ protected virtual void OnDocumentPaneControlStyleChanged(DependencyPropertyChang 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. - /// + /// Gets/sets the to apply to . + [Bindable(true), Description("Gets/sets the Style to apply to LayoutAnchorablePaneControl."), Category("Anchorable")] public Style AnchorablePaneControlStyle { get => (Style)GetValue(AnchorablePaneControlStyleProperty); @@ -420,10 +407,8 @@ protected virtual void OnAnchorablePaneControlStyleChanged(DependencyPropertyCha 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. - /// + /// Gets/sets the to use for document headers. + [Bindable(true), Description("Gets/sets the DataTemplate to use for document headers."), Category("Document")] public DataTemplate DocumentHeaderTemplate { get => (DataTemplate)GetValue(DocumentHeaderTemplateProperty); @@ -454,10 +439,8 @@ private static object CoerceDocumentHeaderTemplateValue(DependencyObject d, obje 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. - /// + /// Gets /sets the that can be used for selecting a for a document header. + [Bindable(true), Description("Gets /sets the DataTemplateSelector that can be used for selecting a DataTemplates for a document header."), Category("Document")] public DataTemplateSelector DocumentHeaderTemplateSelector { get => (DataTemplateSelector)GetValue(DocumentHeaderTemplateSelectorProperty); @@ -487,10 +470,8 @@ protected virtual void OnDocumentHeaderTemplateSelectorChanged(DependencyPropert 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. - /// + /// Gets/sets the to use for displaying the title of a document. + [Bindable(true), Description("Gets/sets the DataTemplate to use for displaying the title of a document."), Category("Document")] public DataTemplate DocumentTitleTemplate { get => (DataTemplate)GetValue(DocumentTitleTemplateProperty); @@ -521,10 +502,8 @@ private static object CoerceDocumentTitleTemplateValue(DependencyObject d, objec 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. - /// + /// Gets/sets the to use for displaying the of a document's title. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to use for displaying the DataTemplate of a document's title."), Category("Document")] public DataTemplateSelector DocumentTitleTemplateSelector { get => (DataTemplateSelector)GetValue(DocumentTitleTemplateSelectorProperty); @@ -552,10 +531,8 @@ protected virtual void OnDocumentTitleTemplateSelectorChanged(DependencyProperty 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. - /// + /// Gets/sets the to use for the title of an anchorable. + [Bindable(true), Description("Gets/sets the DataTemplate to use for the title of an anchorable."), Category("Anchorable")] public DataTemplate AnchorableTitleTemplate { get => (DataTemplate)GetValue(AnchorableTitleTemplateProperty); @@ -586,10 +563,8 @@ private static object CoerceAnchorableTitleTemplateValue(DependencyObject d, obj 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. - /// + /// Gets/sets the to use when selecting a for the title of an anchorable. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to use when selecting a DataTemplate for the title of an anchorable."), Category("Anchorable")] public DataTemplateSelector AnchorableTitleTemplateSelector { get => (DataTemplateSelector)GetValue(AnchorableTitleTemplateSelectorProperty); @@ -614,7 +589,8 @@ protected virtual void OnAnchorableTitleTemplateSelectorChanged(DependencyProper 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. + /// Gets/sets the to use for a header of an anchorable. + [Bindable(true), Description("Gets/sets the DataTemplate to use for a header of an anchorable"), Category("Anchorable")] public DataTemplate AnchorableHeaderTemplate { get => (DataTemplate)GetValue(AnchorableHeaderTemplateProperty); @@ -645,10 +621,8 @@ private static object CoerceAnchorableHeaderTemplateValue(DependencyObject d, ob 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. - /// + /// Gets/sets the to use for selecting the for the header of an anchorable. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to use for selecting the DataTemplate for the header of an anchorable."), Category("Anchorable")] public DataTemplateSelector AnchorableHeaderTemplateSelector { get => (DataTemplateSelector)GetValue(AnchorableHeaderTemplateSelectorProperty); @@ -673,10 +647,8 @@ protected virtual void OnAnchorableHeaderTemplateSelectorChanged(DependencyPrope 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. - /// + /// Gets/sets the layout which is attached to the Layout.Root property. + [Bindable(true), Description("Gets/sets the layout LayoutPanelControl which is attached to the Layout.Root property."), Category("Layout")] public LayoutPanelControl LayoutRootPanel { get => (LayoutPanelControl)GetValue(LayoutRootPanelProperty); @@ -703,7 +675,8 @@ protected virtual void OnLayoutRootPanelChanged(DependencyPropertyChangedEventAr 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. + /// Gets/sets the that is displayed as right side panel control. + [Bindable(true), Description("Gets/sets the LayoutAnchorSideControl that is displayed as right side panel control."), Category("Side Panel")] public LayoutAnchorSideControl RightSidePanel { get => (LayoutAnchorSideControl)GetValue(RightSidePanelProperty); @@ -730,7 +703,8 @@ protected virtual void OnRightSidePanelChanged(DependencyPropertyChangedEventArg 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. + /// Gets/sets the that is displayed as left side panel control. + [Bindable(true), Description("Gets/sets the LayoutAnchorSideControl that is displayed as left side panel control."), Category("Side Panel")] public LayoutAnchorSideControl LeftSidePanel { get => (LayoutAnchorSideControl)GetValue(LeftSidePanelProperty); @@ -757,7 +731,8 @@ protected virtual void OnLeftSidePanelChanged(DependencyPropertyChangedEventArgs 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. + /// Gets/sets the that is displayed as top side panel control. + [Bindable(true), Description("Gets/sets the LayoutAnchorSideControl that is displayed as top side panel control."), Category("Side Panel")] public LayoutAnchorSideControl TopSidePanel { get => (LayoutAnchorSideControl)GetValue(TopSidePanelProperty); @@ -784,7 +759,8 @@ protected virtual void OnTopSidePanelChanged(DependencyPropertyChangedEventArgs 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. + /// Gets/sets the that is displayed as bottom side panel control. + [Bindable(true), Description("Gets/sets the LayoutAnchorSideControl that is displayed as bottom side panel control."), Category("Side Panel")] public LayoutAnchorSideControl BottomSidePanel { get => (LayoutAnchorSideControl)GetValue(BottomSidePanelProperty); @@ -805,46 +781,6 @@ protected virtual void OnBottomSidePanelChanged(DependencyPropertyChangedEventAr #endregion BottomSidePanel - #region LogicalChildren - - private readonly List _logicalChildren = new List(); - - /// - protected override IEnumerator LogicalChildren => _logicalChildren.Select(ch => ch.GetValueOrDefault()).GetEnumerator(); - - public IEnumerator LogicalChildrenPublic => LogicalChildren; - - - internal void InternalAddLogicalChild(object element) - { -#if DEBUG - if (_logicalChildren.Select(ch => ch.GetValueOrDefault()).Contains(element)) - throw new InvalidOperationException(); -#endif - if (_logicalChildren.Select(ch => ch.GetValueOrDefault()).Contains(element)) - return; - - _logicalChildren.Add(new WeakReference(element)); - AddLogicalChild(element); - } - - internal void InternalRemoveLogicalChild(object element) - { - var wrToRemove = _logicalChildren.FirstOrDefault(ch => ch.GetValueOrDefault() == element); - if (wrToRemove != null) - _logicalChildren.Remove(wrToRemove); - RemoveLogicalChild(element); - } - - private void ClearLogicalChildrenList() - { - foreach (var child in _logicalChildren.Select(ch => ch.GetValueOrDefault()).ToArray()) - RemoveLogicalChild(child); - _logicalChildren.Clear(); - } - - #endregion LogicalChildren - #region AutoHideWindow /// Read-Only dependency property. @@ -853,7 +789,8 @@ private void ClearLogicalChildrenList() public static readonly DependencyProperty AutoHideWindowProperty = AutoHideWindowPropertyKey.DependencyProperty; - /// Gets the property. This dependency property indicates the currently shown autohide window. + /// Gets the that is currently shown as autohide window. + [Bindable(true), Description("Gets the LayoutAutoHideWindowControl that is currently shown as autohide window."), Category("AutoHideWindow")] public LayoutAutoHideWindowControl AutoHideWindow => (LayoutAutoHideWindowControl)GetValue(AutoHideWindowProperty); /// @@ -897,6 +834,7 @@ protected virtual void OnAutoHideWindowChanged(DependencyPropertyChangedEventArg /// Expected behavior: The system waits for the configured time and reduces the (into its side anchor). /// Recommended configuration value range should be between 0 and 1500 milliseconds. /// + [Bindable(true), Description("Gets/sets the wait time in milliseconds that is applicable when the system AutoHides a LayoutAnchorableControl (reduces it to a side anchor)."), Category("AutoHideWindow")] public int AutoHideDelay { get => (int)GetValue(AutoHideDelayProperty); @@ -904,7 +842,8 @@ public int AutoHideDelay } #endregion AutoHideDelay - /// Floating Windows + /// Enumerates all s managed by this framework. + [Bindable(false), Description("Enumerates all LayoutFloatingWindowControls managed by this framework."), Category("FloatingWindow")] public IEnumerable FloatingWindows => _fwList; #region LayoutItemTemplate @@ -913,10 +852,8 @@ public int AutoHideDelay public static readonly DependencyProperty LayoutItemTemplateProperty = DependencyProperty.Register(nameof(LayoutItemTemplate), typeof(DataTemplate), typeof(DockingManager), new FrameworkPropertyMetadata((DataTemplate)null, OnLayoutItemTemplateChanged)); - /// - /// Gets or sets the property. This dependency property - /// indicates the template to use to render anchorable and document contents. - /// + /// Gets/sets the used to render anchorable and document content. + [Bindable(true), Description("Gets/sets the DataTemplate used to render anchorable and document content."), Category("Layout")] public DataTemplate LayoutItemTemplate { get => (DataTemplate)GetValue(LayoutItemTemplateProperty); @@ -939,7 +876,8 @@ protected virtual void OnLayoutItemTemplateChanged(DependencyPropertyChangedEven public static readonly DependencyProperty LayoutItemTemplateSelectorProperty = DependencyProperty.Register(nameof(LayoutItemTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnLayoutItemTemplateSelectorChanged)); - /// Gets or sets the property. This dependency property indicates selector object to use for anchorable templates. + /// Gets/sets the to select a of an anchorable. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to select a DataTemplate of an anchorable."), Category("Layout")] public DataTemplateSelector LayoutItemTemplateSelector { get => (DataTemplateSelector)GetValue(LayoutItemTemplateSelectorProperty); @@ -962,7 +900,8 @@ protected virtual void OnLayoutItemTemplateSelectorChanged(DependencyPropertyCha public static readonly DependencyProperty DocumentsSourceProperty = DependencyProperty.Register(nameof(DocumentsSource), typeof(IEnumerable), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnDocumentsSourceChanged)); - /// Gets or sets the property. This dependency property indicates the source collection of documents. + /// Gets/sets the source collection of objects. + [Bindable(true), Description("Gets/sets the source collection of LayoutDocument objects."), Category("Document")] public IEnumerable DocumentsSource { get => (IEnumerable)GetValue(DocumentsSourceProperty); @@ -987,7 +926,8 @@ protected virtual void OnDocumentsSourceChanged(DependencyPropertyChangedEventAr public static readonly DependencyProperty DocumentContextMenuProperty = DependencyProperty.Register(nameof(DocumentContextMenu), typeof(ContextMenu), typeof(DockingManager), new FrameworkPropertyMetadata((ContextMenu)null, OnContextMenuPropertyChanged)); - /// Gets or sets the property. This dependency property indicates context menu to show for documents. + /// Gets/sets the to show for a document. + [Bindable(true), Description("Gets/sets the ContextMenu to show for a document."), Category("Document")] public ContextMenu DocumentContextMenu { get => (ContextMenu)GetValue(DocumentContextMenuProperty); @@ -1002,7 +942,8 @@ public ContextMenu DocumentContextMenu public static readonly DependencyProperty AnchorablesSourceProperty = DependencyProperty.Register(nameof(AnchorablesSource), typeof(IEnumerable), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnAnchorablesSourceChanged)); - /// Gets or sets the property. This dependency property indicates source collection of anchorables. + /// Gets/sets the source collection for all objects managed in this framework. + [Bindable(true), Description("Gets/sets the source collection for all LayoutAnchorable objects managed in this framework."), Category("Anchorable")] public IEnumerable AnchorablesSource { get => (IEnumerable)GetValue(AnchorablesSourceProperty); @@ -1027,7 +968,8 @@ protected virtual void OnAnchorablesSourceChanged(DependencyPropertyChangedEvent public static readonly DependencyProperty ActiveContentProperty = DependencyProperty.Register(nameof(ActiveContent), typeof(object), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnActiveContentChanged)); - /// Gets or sets the property. This dependency property indicates the content currently active. + /// Gets/sets the content that is currently active (document,anchoreable, or null). + [Bindable(true), Description("Gets/sets the content that is currently active (document,anchoreable, or null)."), Category("Other")] public object ActiveContent { get => (object)GetValue(ActiveContentProperty); @@ -1052,7 +994,8 @@ private static void OnActiveContentChanged(DependencyObject d, DependencyPropert public static readonly DependencyProperty AnchorableContextMenuProperty = DependencyProperty.Register(nameof(AnchorableContextMenu), typeof(ContextMenu), typeof(DockingManager), new FrameworkPropertyMetadata((ContextMenu)null, OnContextMenuPropertyChanged)); - /// Gets or sets the property. This dependency property indicates the context menu to show up for anchorables. + /// Gets/sets the to show on an anchorable. + [Bindable(true), Description("Gets/sets the ContextMenu to show on an anchorable."), Category("Anchorable")] public ContextMenu AnchorableContextMenu { get => (ContextMenu)GetValue(AnchorableContextMenuProperty); @@ -1067,7 +1010,8 @@ public ContextMenu AnchorableContextMenu public static readonly DependencyProperty ThemeProperty = DependencyProperty.Register(nameof(Theme), typeof(Theme), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnThemeChanged)); - /// Gets or sets the property. This dependency property indicates the theme to use for AvalonDock controls. + /// Gets/sets the to be used for the controls in this framework. + [Bindable(true), Description("Gets/sets the Theme to be used for the controls in this framework."), Category("Other")] public Theme Theme { get => (Theme)GetValue(ThemeProperty); @@ -1128,7 +1072,8 @@ protected virtual void OnThemeChanged(DependencyPropertyChangedEventArgs e) public static readonly DependencyProperty GridSplitterWidthProperty = DependencyProperty.Register(nameof(GridSplitterWidth), typeof(double), typeof(DockingManager), new FrameworkPropertyMetadata(6.0)); - /// Gets or sets the property. This dependency property indicates width of grid splitters. + /// Gets/sets the width of a grid splitter. + [Bindable(true), Description("Gets/sets the width of a grid splitter"), Category("Other")] public double GridSplitterWidth { get => (double)GetValue(GridSplitterWidthProperty); @@ -1143,7 +1088,8 @@ public double GridSplitterWidth public static readonly DependencyProperty GridSplitterHeightProperty = DependencyProperty.Register(nameof(GridSplitterHeight), typeof(double), typeof(DockingManager), new FrameworkPropertyMetadata(6.0)); - /// Gets or sets the property. This dependency property indicates height of grid splitters. + /// Gets/sets the height of a grid splitter. + [Bindable(true), Description("Gets/sets the height of a grid splitter"), Category("Other")] public double GridSplitterHeight { get => (double)GetValue(GridSplitterHeightProperty); @@ -1158,7 +1104,8 @@ public double GridSplitterHeight public static readonly DependencyProperty DocumentPaneMenuItemHeaderTemplateProperty = DependencyProperty.Register(nameof(DocumentPaneMenuItemHeaderTemplate), typeof(DataTemplate), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnDocumentPaneMenuItemHeaderTemplateChanged, CoerceDocumentPaneMenuItemHeaderTemplateValue)); - /// Gets or sets the property. This dependency property indicates the header template to use while creating menu items for the document panes. + /// Gets/sets the for the header to display menu dropdown items on a document pane. + [Bindable(true), Description("Gets/sets the DataTemplate for the header to display menu dropdown items on a document pane."), Category("Other")] public DataTemplate DocumentPaneMenuItemHeaderTemplate { get => (DataTemplate)GetValue(DocumentPaneMenuItemHeaderTemplateProperty); @@ -1189,10 +1136,8 @@ private static object CoerceDocumentPaneMenuItemHeaderTemplateValue(DependencyOb public static readonly DependencyProperty DocumentPaneMenuItemHeaderTemplateSelectorProperty = DependencyProperty.Register(nameof(DocumentPaneMenuItemHeaderTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnDocumentPaneMenuItemHeaderTemplateSelectorChanged, CoerceDocumentPaneMenuItemHeaderTemplateSelectorValue)); - /// - /// Gets or sets the property. This dependency property - /// indicates the data template selector to use for the menu items show when user select the DocumentPane document switch context menu. - /// + /// Gets/sets the to select a for the menu items shown when user selects the context menu switch. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to select a DataTemplate for the menu items shown when user selects the LayoutDocumentPaneControl context menu switch."), Category("Document")] public DataTemplateSelector DocumentPaneMenuItemHeaderTemplateSelector { get => (DataTemplateSelector)GetValue(DocumentPaneMenuItemHeaderTemplateSelectorProperty); @@ -1220,10 +1165,8 @@ protected virtual void OnDocumentPaneMenuItemHeaderTemplateSelectorChanged(Depen public static readonly DependencyProperty IconContentTemplateProperty = DependencyProperty.Register(nameof(IconContentTemplate), typeof(DataTemplate), typeof(DockingManager), new FrameworkPropertyMetadata((DataTemplate)null)); - /// - /// Gets or sets the property. This dependency property - /// indicates the data template to use while extracting the icon from model. - /// + /// Gets/sets the to use on the icon extracted from the layout model. + [Bindable(true), Description("Gets/sets the DataTemplate to use on the icon extracted from the layout model."), Category("Other")] public DataTemplate IconContentTemplate { get => (DataTemplate)GetValue(IconContentTemplateProperty); @@ -1238,10 +1181,8 @@ public DataTemplate IconContentTemplate public static readonly DependencyProperty IconContentTemplateSelectorProperty = DependencyProperty.Register(nameof(IconContentTemplateSelector), typeof(DataTemplateSelector), typeof(DockingManager), new FrameworkPropertyMetadata((DataTemplateSelector)null)); - /// - /// Gets or sets the property. This dependency property - /// indicates data template selector to use while selecting the data template for content icons. - /// + /// Gets/sets the to select a for a content icon. + [Bindable(true), Description("Gets/sets the DataTemplateSelector to select a DataTemplate for a content icon."), Category("Other")] public DataTemplateSelector IconContentTemplateSelector { get => (DataTemplateSelector)GetValue(IconContentTemplateSelectorProperty); @@ -1256,10 +1197,8 @@ public DataTemplateSelector IconContentTemplateSelector public static readonly DependencyProperty LayoutItemContainerStyleProperty = DependencyProperty.Register(nameof(LayoutItemContainerStyle), typeof(Style), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnLayoutItemContainerStyleChanged)); - /// - /// Gets or sets the property. This dependency property - /// indicates the style to apply to objects. A object is created when a new is created inside the current Layout. - /// + /// Gets/sets the to apply to a object. + [Bindable(true), Description("Gets/sets the Style to apply to a LayoutDocumentItem object."), Category("Layout")] public Style LayoutItemContainerStyle { get => (Style)GetValue(LayoutItemContainerStyleProperty); @@ -1280,7 +1219,8 @@ public Style LayoutItemContainerStyle public static readonly DependencyProperty LayoutItemContainerStyleSelectorProperty = DependencyProperty.Register(nameof(LayoutItemContainerStyleSelector), typeof(StyleSelector), typeof(DockingManager), new FrameworkPropertyMetadata(null, OnLayoutItemContainerStyleSelectorChanged)); - /// Gets or sets the property. This dependency property indicates style selector of the . + /// Gets/sets the to select the for a . + [Bindable(true), Description("Gets/sets the StyleSelector to select the Style for a LayoutDocumentItem."), Category("Layout")] public StyleSelector LayoutItemContainerStyleSelector { get => (StyleSelector)GetValue(LayoutItemContainerStyleSelectorProperty); @@ -1317,7 +1257,8 @@ public bool ShowSystemMenu public static readonly DependencyProperty AllowMixedOrientationProperty = DependencyProperty.Register(nameof(AllowMixedOrientation), typeof(bool), typeof(DockingManager), new FrameworkPropertyMetadata(false)); - /// Gets or sets the property. This dependency property indicates if the manager should allow mixed orientation for document panes. + /// Gets/sets whether the DockingManager should allow mixed orientation for document panes. + [Bindable(true), Description("Gets/sets whether the DockingManager should allow mixed orientation for document panes."), Category("Other")] public bool AllowMixedOrientation { get => (bool)GetValue(AllowMixedOrientationProperty); @@ -1328,16 +1269,14 @@ public bool AllowMixedOrientation #region IsVirtualizingLayoutDocument IsVirtualizingLayoutAnchorable - /// - /// Gets/sets (a simple non-dependency property) to determine whether the - /// is virtualizing its tabbed item child controls or not. - /// + /// Gets/sets (a simple non-dependency property) to determine whether the + /// is virtualizing its tabbed item child controls or not. + [Bindable(false), Description("Gets/sets whether the LayoutDocumentPaneControl is virtualizing its tabbed item child controls or not."), Category("Document")] public bool IsVirtualizingDocument { get; set; } - /// - /// Gets/sets (a simple non-dependency property) to determine whether the - /// is virtualizing its tabbed item child controls or not. - /// + /// Gets/sets (a simple non-dependency property) to determine whether the + /// is virtualizing its tabbed item child controls or not. + [Bindable(false), Description("Gets/sets whether the LayoutAnchorablePaneControl is virtualizing its tabbed item child controls or not."), Category("Anchorable")] public bool IsVirtualizingAnchorable { get; set; } #endregion IsVirtualizingLayoutDocument IsVirtualizingLayoutAnchorable @@ -1364,6 +1303,46 @@ public bool AutoWindowSizeWhenOpened #endregion Public Properties + #region LogicalChildren + + private readonly List _logicalChildren = new List(); + + /// + protected override IEnumerator LogicalChildren => _logicalChildren.Select(ch => ch.GetValueOrDefault()).GetEnumerator(); + + public IEnumerator LogicalChildrenPublic => LogicalChildren; + + + internal void InternalAddLogicalChild(object element) + { +#if DEBUG + if (_logicalChildren.Select(ch => ch.GetValueOrDefault()).Contains(element)) + throw new InvalidOperationException(); +#endif + if (_logicalChildren.Select(ch => ch.GetValueOrDefault()).Contains(element)) + return; + + _logicalChildren.Add(new WeakReference(element)); + AddLogicalChild(element); + } + + internal void InternalRemoveLogicalChild(object element) + { + var wrToRemove = _logicalChildren.FirstOrDefault(ch => ch.GetValueOrDefault() == element); + if (wrToRemove != null) + _logicalChildren.Remove(wrToRemove); + RemoveLogicalChild(element); + } + + private void ClearLogicalChildrenList() + { + foreach (var child in _logicalChildren.Select(ch => ch.GetValueOrDefault()).ToArray()) + RemoveLogicalChild(child); + _logicalChildren.Clear(); + } + + #endregion LogicalChildren + #region Private Properties private bool IsNavigatorWindowActive => _navigatorWindow != null;