Skip to content

Commit

Permalink
Added more Bindable properties to resolve #179
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Jul 13, 2020
1 parent 193f0e8 commit 4f16bb7
Show file tree
Hide file tree
Showing 24 changed files with 166 additions and 262 deletions.
7 changes: 5 additions & 2 deletions source/Components/AvalonDock/Controls/AnchorablePaneTitle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This program is provided to you under the terms of the Microsoft Public
************************************************************************/

using AvalonDock.Layout;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -48,7 +49,8 @@ static AnchorablePaneTitle()
public static readonly DependencyProperty ModelProperty = DependencyProperty.Register(nameof(Model), typeof(LayoutAnchorable), typeof(AnchorablePaneTitle),
new FrameworkPropertyMetadata(null, _OnModelChanged));

/// <summary>Gets or sets the <see cref="Model"/> property. This dependency property indicates model attached to this view.</summary>
/// <summary>Gets/sets the <see cref="LayoutAnchorable"/> model attached of this view.</summary>
[Bindable(true), Description("Gets/sets the LayoutAnchorable model attached of this view."), Category("Anchorable")]
public LayoutAnchorable Model
{
get => (LayoutAnchorable)GetValue(ModelProperty);
Expand Down Expand Up @@ -76,7 +78,8 @@ protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)

public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty;

/// <summary>Gets the <see cref="LayoutItem"/> property. This dependency property indicates the LayoutItem attached to this tag item.</summary>
/// <summary>Gets the <see cref="LayoutItem"/> (<see cref="LayoutAnchorableItem"/> or <see cref="LayoutDocumentItem"/>) attached to this view.</summary>
[Bindable(true), Description("Gets the LayoutItem (LayoutAnchorableItem or LayoutDocumentItem) attached to this object."), Category("Layout")]
public LayoutItem LayoutItem => (LayoutItem)GetValue(LayoutItemProperty);

/// <summary>
Expand Down
7 changes: 3 additions & 4 deletions source/Components/AvalonDock/Controls/DropArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************/

using System.ComponentModel;
using System.Windows;

namespace AvalonDock.Controls
Expand Down Expand Up @@ -73,10 +74,8 @@ internal DropArea(T areaElement, DropAreaType type)

#region Properties

/// <summary>
/// Gets the <see cref="FrameworkElement"/> that implements a drop target
/// for a drag & drop (dock) operation.
/// </summary>
/// <summary>Gets the <see cref="FrameworkElement"/> that implements a drop target for a drag & drop (dock) operation.</summary>
[Bindable(false), Description("Gets the FrameworkElement that implements a drop target for a drag & drop (dock) operation."), Category("Other")]
public T AreaElement { get; }

#endregion Properties
Expand Down
13 changes: 5 additions & 8 deletions source/Components/AvalonDock/Controls/DropDownButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************/

using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -40,10 +41,8 @@ public DropDownButton()
public static readonly DependencyProperty DropDownContextMenuProperty = DependencyProperty.Register(nameof(DropDownContextMenu), typeof(ContextMenu), typeof(DropDownButton),
new FrameworkPropertyMetadata(null, OnDropDownContextMenuChanged));

/// <summary>
/// Gets or sets the <see cref="DropDownContextMenu"/> property. This dependency property
/// indicates drop down menu to show up when user click on an anchorable menu pin.
/// </summary>
/// <summary>Gets/sets the drop down menu to show up when user click on an anchorable menu pin.</summary>
[Bindable(true), Description("Gets/sets the drop down menu to show up when user click on an anchorable menu pin."), Category("Menu")]
public ContextMenu DropDownContextMenu
{
get => (ContextMenu)GetValue(DropDownContextMenuProperty);
Expand All @@ -68,10 +67,8 @@ protected virtual void OnDropDownContextMenuChanged(DependencyPropertyChangedEve
public static readonly DependencyProperty DropDownContextMenuDataContextProperty = DependencyProperty.Register(nameof(DropDownContextMenuDataContext), typeof(object), typeof(DropDownButton),
new FrameworkPropertyMetadata(null));

/// <summary>
/// Gets or sets the <see cref="DropDownContextMenuDataContext"/> property. This dependency property
/// indicates data context to set for drop down context menu.
/// </summary>
/// <summary>Gets/sets the DataContext to set for the DropDownContext menu property.</summary>
[Bindable(true), Description("Gets/sets the DataContext to set for the DropDownContext menu property."), Category("Menu")]
public object DropDownContextMenuDataContext
{
get => GetValue(DropDownContextMenuDataContextProperty);
Expand Down
13 changes: 5 additions & 8 deletions source/Components/AvalonDock/Controls/DropDownControlArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************/

using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand All @@ -32,10 +33,8 @@ public class DropDownControlArea : ContentControl
public static readonly DependencyProperty DropDownContextMenuProperty = DependencyProperty.Register(nameof(DropDownContextMenu), typeof(ContextMenu), typeof(DropDownControlArea),
new FrameworkPropertyMetadata(null));

/// <summary>
/// Gets or sets the <see cref="DropDownContextMenu"/> property. This dependency property
/// indicates context menu to show when a right click is detected over the area occupied by the control.
/// </summary>
/// <summary>Gets/sets the drop down menu to show up when user click on an anchorable menu pin.</summary>
[Bindable(true), Description("Gets/sets the drop down menu to show up when user click on an anchorable menu pin."), Category("Menu")]
public ContextMenu DropDownContextMenu
{
get => (ContextMenu)GetValue(DropDownContextMenuProperty);
Expand All @@ -50,10 +49,8 @@ public ContextMenu DropDownContextMenu
public static readonly DependencyProperty DropDownContextMenuDataContextProperty = DependencyProperty.Register(nameof(DropDownContextMenuDataContext), typeof(object), typeof(DropDownControlArea),
new FrameworkPropertyMetadata(null));

/// <summary>
/// Gets or sets the <see cref="DropDownContextMenuDataContext"/> property. This dependency property
/// indicates data context to attach when context menu is shown.
/// </summary>
/// <summary>Gets/sets the DataContext to set for the DropDownContext menu property.</summary>
[Bindable(true), Description("Gets/sets the DataContext to set for the DropDownContext menu property."), Category("Menu")]
public object DropDownContextMenuDataContext
{
get => (object)GetValue(DropDownContextMenuDataContextProperty);
Expand Down
15 changes: 5 additions & 10 deletions source/Components/AvalonDock/Controls/DropTargetBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************/

using System.ComponentModel;
using System.Windows;

namespace AvalonDock.Controls
{
/// <summary>
/// Implements a base implementation for the abstract <see cref="DropTarget{T}"/> class.
/// </summary>
/// <summary>Implements a base implementation for the abstract <see cref="DropTarget{T}"/> class.</summary>
internal abstract class DropTargetBase : DependencyObject
{
#region Properties

#region IsDraggingOver

/// <summary>
/// IsDraggingOver Attached Dependency Property
/// </summary>
/// <summary>IsDraggingOver Attached Dependency Property</summary>
public static readonly DependencyProperty IsDraggingOverProperty = DependencyProperty.RegisterAttached("IsDraggingOver", typeof(bool), typeof(DropTargetBase),
new FrameworkPropertyMetadata((bool)false));

/// <summary>
/// Gets the IsDraggingOver property.
/// This dependency property indicates if user is dragging a window over the target element.
/// </summary>
/// <summary>Gets wether the user is dragging a window over the target element.</summary>
[Bindable(true), Description("Gets wether the user is dragging a window over the target element."), Category("Other")]
public static bool GetIsDraggingOver(DependencyObject d)
{
return (bool)d.GetValue(IsDraggingOverProperty);
Expand Down
66 changes: 18 additions & 48 deletions source/Components/AvalonDock/Controls/DropTargetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,90 +17,60 @@ public enum DropTargetType
{
#region DockingManager

/// <summary>
/// The specific drop area is the left of the <see cref="DockingManager"/> control.
/// </summary>
/// <summary>The specific drop area is the left of the <see cref="DockingManager"/> control.</summary>
DockingManagerDockLeft,

/// <summary>
/// The specific drop area is the top of the <see cref="DockingManager"/> control.
/// </summary>
/// <summary>The specific drop area is the top of the <see cref="DockingManager"/> control.</summary>
DockingManagerDockTop,

/// <summary>
/// The specific drop area is the right of the <see cref="DockingManager"/> control.
/// </summary>
/// <summary>The specific drop area is the right of the <see cref="DockingManager"/> control.</summary>
DockingManagerDockRight,

/// <summary>
/// The specific drop area is the bottom of the <see cref="DockingManager"/> control.
/// </summary>
/// <summary>The specific drop area is the bottom of the <see cref="DockingManager"/> control.</summary>
DockingManagerDockBottom,

#endregion DockingManager

#region DocumentPane

/// <summary>
/// The specific drop area is the left of a <see cref="LayoutDocumentPaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the left of a <see cref="LayoutDocumentPaneControl"/> control.</summary>
DocumentPaneDockLeft,

/// <summary>
/// The specific drop area is the top of a <see cref="LayoutDocumentPaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the top of a <see cref="LayoutDocumentPaneControl"/> control.</summary>
DocumentPaneDockTop,

/// <summary>
/// The specific drop area is the right of a <see cref="LayoutDocumentPaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the right of a <see cref="LayoutDocumentPaneControl"/> control.</summary>
DocumentPaneDockRight,

/// <summary>
/// The specific drop area is the bottom of a <see cref="LayoutDocumentPaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the bottom of a <see cref="LayoutDocumentPaneControl"/> control.</summary>
DocumentPaneDockBottom,

/// <summary>
/// The specific drop area is a <see cref="LayoutDocumentPaneControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).
/// </summary>
/// <summary>The specific drop area is a <see cref="LayoutDocumentPaneControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).</summary>
DocumentPaneDockInside,

#endregion DocumentPane

/// <summary>
/// The specific drop area is a <see cref="LayoutDocumentPaneGroupControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).
/// </summary>
/// <summary>The specific drop area is a <see cref="LayoutDocumentPaneGroupControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).</summary>
DocumentPaneGroupDockInside,

#region AnchorablePane

/// <summary>
/// The specific drop area is the left of a <see cref="LayoutAnchorablePaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the left of a <see cref="LayoutAnchorablePaneControl"/> control.</summary>
AnchorablePaneDockLeft,

/// <summary>
/// The specific drop area is the top of a <see cref="LayoutAnchorablePaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the top of a <see cref="LayoutAnchorablePaneControl"/> control.</summary>
AnchorablePaneDockTop,

/// <summary>
/// The specific drop area is the right of a <see cref="LayoutAnchorablePaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the right of a <see cref="LayoutAnchorablePaneControl"/> control.</summary>
AnchorablePaneDockRight,

/// <summary>
/// The specific drop area is the bottom of a <see cref="LayoutAnchorablePaneControl"/> control.
/// </summary>
/// <summary>The specific drop area is the bottom of a <see cref="LayoutAnchorablePaneControl"/> control.</summary>
AnchorablePaneDockBottom,

/// <summary>
/// The specific drop area is a <see cref="LayoutAnchorablePaneControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).
/// </summary>
/// <summary>The specific drop area is a <see cref="LayoutAnchorablePaneControl"/> control (the dropped control
/// and the drop target will be part of a tabbed display).</summary>
AnchorablePaneDockInside,

#endregion AnchorablePane
Expand Down
7 changes: 3 additions & 4 deletions source/Components/AvalonDock/Controls/LayoutAnchorControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This program is provided to you under the terms of the Microsoft Public

using AvalonDock.Layout;
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
Expand Down Expand Up @@ -67,10 +68,8 @@ public ILayoutElement Model

public static readonly DependencyProperty SideProperty = SidePropertyKey.DependencyProperty;

/// <summary>
/// Gets the Side property. This dependency property
/// indicates the anchor side of the control.
/// </summary>
/// <summary>Gets the anchor side of the control.</summary>
[Bindable(true), Description("Gets the anchor side of the control."), Category("Anchor")]
public AnchorSide Side
{
get
Expand Down
13 changes: 9 additions & 4 deletions source/Components/AvalonDock/Controls/LayoutAnchorSideControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This program is provided to you under the terms of the Microsoft Public
using AvalonDock.Layout;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -68,7 +69,8 @@ internal LayoutAnchorSideControl(LayoutAnchorSide model)

public static readonly DependencyProperty IsLeftSideProperty = IsLeftSidePropertyKey.DependencyProperty;

/// <summary>Gets the <see cref="IsLeftSide"/> property. This dependency property indicates this control is anchored to left side.</summary>
/// <summary>Gets wether the control is anchored to left side.</summary>
[Bindable(true), Description("Gets wether the control is anchored to left side."), Category("Anchor")]
public bool IsLeftSide => (bool)GetValue(IsLeftSideProperty);

/// <summary>Provides a secure method for setting the <see cref="IsLeftSide"/> property. This dependency property indicates this control is anchored to left side.</summary>
Expand All @@ -85,7 +87,8 @@ internal LayoutAnchorSideControl(LayoutAnchorSide model)

public static readonly DependencyProperty IsTopSideProperty = IsTopSidePropertyKey.DependencyProperty;

/// <summary>Gets the <see cref="IsTopSide"/> property. This dependency property indicates this control is anchored to top side.</summary>
/// <summary>Gets wether the control is anchored to top side.</summary>
[Bindable(true), Description("Gets wether the control is anchored to top side."), Category("Anchor")]
public bool IsTopSide => (bool)GetValue(IsTopSideProperty);

/// <summary>Provides a secure method for setting the <see cref="IsTopSide"/> property. This dependency property indicates this control is anchored to top side.</summary>
Expand All @@ -102,7 +105,8 @@ internal LayoutAnchorSideControl(LayoutAnchorSide model)

public static readonly DependencyProperty IsRightSideProperty = IsRightSidePropertyKey.DependencyProperty;

/// <summary>Gets the <see cref="IsRightSide"/> property. This dependency property indicates this control is anchored to right side.</summary>
/// <summary>Gets wether the control is anchored to right side.</summary>
[Bindable(true), Description("Gets wether the control is anchored to right side."), Category("Anchor")]
public bool IsRightSide => (bool)GetValue(IsRightSideProperty);

/// <summary>Provides a secure method for setting the <see cref="IsRightSide"/> property. This dependency property indicates this control is anchored to right side.</summary>
Expand All @@ -119,7 +123,8 @@ internal LayoutAnchorSideControl(LayoutAnchorSide model)

public static readonly DependencyProperty IsBottomSideProperty = IsBottomSidePropertyKey.DependencyProperty;

/// <summary>Gets the <see cref="IsBottomSide"/> property. This dependency property indicates if this panel is anchored to bottom side.</summary>
/// <summary>Gets whether the control is anchored to bottom side.</summary>
[Bindable(true), Description("Gets whether the control is anchored to bottom side."), Category("Anchor")]
public bool IsBottomSide => (bool)GetValue(IsBottomSideProperty);

/// <summary>Provides a secure method for setting the <see cref="IsBottomSide"/> property. This dependency property indicates if this panel is anchored to bottom side.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This program is provided to you under the terms of the Microsoft Public
************************************************************************/

using AvalonDock.Layout;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;

Expand Down Expand Up @@ -48,7 +49,8 @@ public LayoutAnchorableControl()
public static readonly DependencyProperty ModelProperty = DependencyProperty.Register(nameof(Model), typeof(LayoutAnchorable), typeof(LayoutAnchorableControl),
new FrameworkPropertyMetadata(null, OnModelChanged));

/// <summary>Gets or sets the <see cref="Model"/> property. This dependency property indicates the model attached to this view.</summary>
/// <summary>Gets/sets the model attached to this view.</summary>
[Bindable(true), Description("Gets/sets the model attached to this view."), Category("Other")]
public LayoutAnchorable Model
{
get => (LayoutAnchorable)GetValue(ModelProperty);
Expand Down Expand Up @@ -91,7 +93,8 @@ private void Model_PropertyChanged(object sender, System.ComponentModel.Property

public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty;

/// <summary> Gets the <see cref="LayoutItem"/> property. This dependency property indicates the LayoutItem attached to this tag item.</summary>
/// <summary>Gets the the LayoutItem attached to this tag item.</summary>
[Bindable(true), Description("Gets the the LayoutItem attached to this tag item."), Category("Other")]
public LayoutItem LayoutItem => (LayoutItem)GetValue(LayoutItemProperty);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This program is provided to you under the terms of the Microsoft Public
using Microsoft.Windows.Shell;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -91,10 +92,8 @@ internal LayoutAnchorableFloatingWindowControl(LayoutAnchorableFloatingWindow mo
public static readonly DependencyProperty SingleContentLayoutItemProperty = DependencyProperty.Register(nameof(SingleContentLayoutItem), typeof(LayoutItem), typeof(LayoutAnchorableFloatingWindowControl),
new FrameworkPropertyMetadata(null, OnSingleContentLayoutItemChanged));

/// <summary>
/// Gets or sets the <see cref="SingleContentLayoutItem"/> property. This dependency property
/// indicates the layout item of the selected content when is shown a single anchorable pane.
/// </summary>
/// <summary>Gets/sets the layout item of the selected content when shown in a single anchorable pane.</summary>
[Bindable(true), Description("Gets/sets the layout item of the selected content when shown in a single anchorable pane."), Category("Anchorable")]
public LayoutItem SingleContentLayoutItem
{
get => (LayoutItem)GetValue(SingleContentLayoutItemProperty);
Expand Down
Loading

0 comments on commit 4f16bb7

Please sign in to comment.