Skip to content

Commit

Permalink
Raise PropertyChanged notification when LayoutContent.IsFloating changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdachev committed Aug 14, 2020
1 parent 7ae58b8 commit 55998de
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions source/Components/AvalonDock/Layout/LayoutContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,13 @@ public void Float()
IsSelected = true;
IsActive = true;
}
}

/// <summary>Dock the content as document.</summary>
public void DockAsDocument()
// BD: 14.08.2020 raise IsFloating property changed
RaisePropertyChanged(nameof(IsFloating));
}

/// <summary>Dock the content as document.</summary>
public void DockAsDocument()
{
if (!(Root is LayoutRoot root)) throw new InvalidOperationException();
if (Parent is LayoutDocumentPane) return;
Expand All @@ -631,12 +634,15 @@ public void DockAsDocument()
}
IsSelected = true;
IsActive = true;
}

/// <summary>
/// Re-dock the content to its previous container
/// </summary>
public void Dock()
// BD: 14.08.2020 raise IsFloating property changed
RaisePropertyChanged(nameof(IsFloating));
}

/// <summary>
/// Re-dock the content to its previous container
/// </summary>
public void Dock()
{
if (PreviousContainer != null)
{
Expand Down Expand Up @@ -667,13 +673,16 @@ public void Dock()
InternalDock();

Root.CollectGarbage();
}

#endregion Public Methods
// BD: 14.08.2020 raise IsFloating property changed
RaisePropertyChanged(nameof(IsFloating));
}

#endregion Public Methods

#region Overrides
#region Overrides

protected override void OnParentChanging(ILayoutContainer oldValue, ILayoutContainer newValue)
protected override void OnParentChanging(ILayoutContainer oldValue, ILayoutContainer newValue)
{
if (oldValue != null) IsSelected = false;
//var root = Root;
Expand Down

0 comments on commit 55998de

Please sign in to comment.