Skip to content

Commit

Permalink
V4.1.0 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed May 18, 2021
1 parent 61789cf commit 1ed1e41
Show file tree
Hide file tree
Showing 461 changed files with 952 additions and 622 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

[assembly: AssemblyCompany( "Xceed Software Inc." )]
[assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2020" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2021" )]



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />

<DataTemplate x:Key="DocumentPaneControlContentTemplate">
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
Expand Down Expand Up @@ -524,6 +525,9 @@
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
<Setter Property="ToolTip"
TargetName="PART_AutoHidePin"
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
</DataTrigger>
<DataTrigger Binding="{Binding Model.CanClose, RelativeSource={RelativeSource Mode=Self}}"
Value="True">
Expand Down Expand Up @@ -979,7 +983,7 @@
Command="{Binding Path=DockCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
Command="{Binding Path=DockAsDocumentCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
Command="{Binding Path=AutoHideCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
Command="{Binding Path=CloseCommand}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

[assembly: AssemblyCompany( "Xceed Software Inc." )]
[assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2020" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2021" )]



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />

<DataTemplate x:Key="DocumentPaneControlContentTemplate">
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
Expand Down Expand Up @@ -533,6 +534,9 @@
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
<Setter Property="ToolTip"
TargetName="PART_AutoHidePin"
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
</DataTrigger>
<DataTrigger Binding="{Binding Model.CanClose, RelativeSource={RelativeSource Mode=Self}}"
Value="True">
Expand Down Expand Up @@ -1002,7 +1006,7 @@
Command="{Binding Path=DockCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
Command="{Binding Path=DockAsDocumentCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
Command="{Binding Path=AutoHideCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
Command="{Binding Path=CloseCommand}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

[assembly: AssemblyCompany( "Xceed Software Inc." )]
[assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2020" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2021" )]


// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />

<DataTemplate x:Key="DocumentPaneControlContentTemplate">
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
Expand Down Expand Up @@ -620,6 +621,9 @@
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
<Setter Property="ToolTip"
TargetName="PART_AutoHidePin"
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
</DataTrigger>
<DataTrigger Binding="{Binding Model.IsActive, RelativeSource={RelativeSource Mode=Self}}"
Value="True">
Expand Down Expand Up @@ -1099,7 +1103,7 @@
Command="{Binding Path=DockCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
Command="{Binding Path=DockAsDocumentCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
Command="{Binding Path=AutoHideCommand}" />
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
Command="{Binding Path=CloseCommand}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,20 @@ internal void Abort()
#region Private Methods

private void GetOverlayWindowHosts()
{
_overlayWindowHosts.AddRange( _manager.GetFloatingWindowsByZOrder().OfType<LayoutAnchorableFloatingWindowControl>().Where( fw => fw != _floatingWindow && fw.IsVisible ) );
_overlayWindowHosts.Add( _manager );
{
var windows = _manager.GetWindowsByZOrder().Where( w => (w != _floatingWindow) && w.IsVisible );

foreach( var w in windows )
{
if( w == Window.GetWindow( _manager ) )
{
_overlayWindowHosts.Add( _manager );
}
else if( w is LayoutAnchorableFloatingWindowControl )
{
_overlayWindowHosts.Add( w as LayoutAnchorableFloatingWindowControl );
}
}
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ public void Drop( LayoutFloatingWindow floatingWindow )
{
Dispatcher.BeginInvoke( new Action( () =>
{
if( ( currentActiveContent.Root != null ) && ( currentActiveContent.Root.Manager != null ) )
{
currentActiveContent.Root.Manager.MoveFocus( new TraversalRequest( FocusNavigationDirection.Next ) );
}
currentActiveContent.IsSelected = false;
currentActiveContent.IsActive = false;
currentActiveContent.IsActive = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ protected override void OnSelectionChanged( SelectionChangedEventArgs e )








Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ internal void BringFocusOnDockingManager()
}
}

internal bool IsClosing()
{
return _isClosing;
}

#endregion

#region Private Methods
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/

using System;
using System.Windows.Data;
using System.Globalization;
using Xceed.Wpf.AvalonDock.Properties;

namespace Xceed.Wpf.AvalonDock.Converters
{
public class AnchorableContextMenuAutoHideHeaderConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
var isAutoHidden = value as bool?;

return (isAutoHidden != null) && isAutoHidden.Value ? Resources.Window_Restore : Resources.Anchorable_AutoHide;
}

public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ public DockingManager()







#region Layout

/// <summary>
Expand Down Expand Up @@ -2136,7 +2140,10 @@ internal UIElement CreateUIElementForModel( ILayoutElement model )

Dispatcher.BeginInvoke( new Action( () =>
{
newFW.Show();
if( newFW.IsClosing() )
return;
newFW.Show();
// Do not set the WindowState before showing or it will be lost
if( paneForExtensions != null && paneForExtensions.IsMaximized )
Expand Down Expand Up @@ -2232,6 +2239,9 @@ internal void StartDraggingFloatingWindowForContent( LayoutContent contentModel,
{
Dispatcher.BeginInvoke( new Action( () =>
{
if( fwc.IsClosing() )
return;
if( startDrag )
fwc.AttachDrag();
fwc.Show();
Expand Down Expand Up @@ -2277,6 +2287,41 @@ internal IEnumerable<LayoutFloatingWindowControl> GetFloatingWindowsByZOrder()
}
}

internal IEnumerable<Window> GetWindowsByZOrder()
{
IntPtr windowParentHanlde;
var parentWindow = Window.GetWindow( this );
if( parentWindow != null )
{
windowParentHanlde = new WindowInteropHelper( parentWindow ).Handle;
}
else
{
var mainProcess = Process.GetCurrentProcess();
if( mainProcess == null )
yield break;

windowParentHanlde = mainProcess.MainWindowHandle;
}

IntPtr currentHandle = Win32Helper.GetWindow( windowParentHanlde, ( uint )Win32Helper.GetWindow_Cmd.GW_HWNDFIRST );
while( currentHandle != IntPtr.Zero )
{
if( windowParentHanlde == currentHandle )
{
yield return parentWindow;
}
else
{
LayoutFloatingWindowControl ctrl = _fwList.FirstOrDefault( fw => new WindowInteropHelper( fw ).Handle == currentHandle );
if( ctrl != null && ctrl.Model.Root.Manager == this )
yield return ctrl;
}

currentHandle = Win32Helper.GetWindow( currentHandle, ( uint )Win32Helper.GetWindow_Cmd.GW_HWNDNEXT );
}
}

internal void RemoveFloatingWindow( LayoutFloatingWindowControl floatingWindow )
{
_fwList.Remove( floatingWindow );
Expand Down Expand Up @@ -3359,21 +3404,25 @@ private void UpdateStarSize( LayoutContent contentModel )
return;

var parentPane = contentModel.Parent as ILayoutPositionableElement;
if( parentPane != null)
if( parentPane != null )
{
// Reset Dock Size of floating LayoutContent
if( parentPane.DockWidth.IsStar )
{
parentPane.DockWidth = new GridLength( 1d, GridUnitType.Star );
}
if( parentPane.DockHeight.IsStar )
var parentLayoutContainer = parentPane as ILayoutContainer;
if( ( parentLayoutContainer != null ) && ( parentLayoutContainer.ChildrenCount == 1 ) )
{
parentPane.DockHeight = new GridLength( 1d, GridUnitType.Star );
// Reset Dock Size of floating LayoutContent
if( parentPane.DockWidth.IsStar )
{
parentPane.DockWidth = new GridLength( 1d, GridUnitType.Star );
}
if( parentPane.DockHeight.IsStar )
{
parentPane.DockHeight = new GridLength( 1d, GridUnitType.Star );
}
}

var grandParentPaneOrientation = parentPane.Parent as ILayoutOrientableGroup;
var grandParentPane = parentPane.Parent as ILayoutPositionableElement;
if( (grandParentPaneOrientation != null) && (grandParentPane != null) )
if( ( grandParentPaneOrientation != null ) && ( grandParentPane != null ) )
{
if( grandParentPaneOrientation.Orientation == Orientation.Horizontal )
{
Expand All @@ -3383,7 +3432,10 @@ private void UpdateStarSize( LayoutContent contentModel )
var grandParentPaneContainer = parentPane.Parent as ILayoutContainer;
if( grandParentPaneContainer != null )
{
var children = grandParentPaneContainer.Children.Where( child => !child.Equals( parentPane ) ).Cast<ILayoutPositionableElement>().Where( child => child.DockWidth.IsStar );
var children = grandParentPaneContainer.Children.Where( child => ( child.Equals( parentPane ) && ( parentPane is ILayoutContainer ) && ( ( ( ILayoutContainer )parentPane ).ChildrenCount > 1 ) )
|| !child.Equals( parentPane ) )
.Cast<ILayoutPositionableElement>()
.Where( child => child.DockHeight.IsStar );
var childrenTotalWidth = children.Sum( child => child.DockWidth.Value );
foreach( var child in children )
{
Expand All @@ -3400,7 +3452,10 @@ private void UpdateStarSize( LayoutContent contentModel )
var grandParentPaneContainer = parentPane.Parent as ILayoutContainer;
if( grandParentPaneContainer != null )
{
var children = grandParentPaneContainer.Children.Where( child => !child.Equals( parentPane ) ).Cast<ILayoutPositionableElement>().Where( child => child.DockHeight.IsStar );
var children = grandParentPaneContainer.Children.Where( child => ( child.Equals( parentPane ) && ( parentPane is ILayoutContainer ) && ( ( ( ILayoutContainer )parentPane ).ChildrenCount > 1 ) )
|| !child.Equals( parentPane ) )
.Cast<ILayoutPositionableElement>()
.Where( child => child.DockHeight.IsStar );
var childrenTotalHeight = children.Sum( child => child.DockHeight.Value );
foreach( var child in children )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,18 +664,18 @@ public void ToggleAutoHide()
cnt.PreviousContainer = previousContainer;
}

foreach( var anchorableToToggle in parentGroup.Children.ToArray() )
{
previousContainer.Children.Add( anchorableToToggle );
}
previousContainer.Children.Add( this );

if( previousContainer.Children.Count > 0 )
{
// Select the LayoutContent where the Toggle pin button was pressed.
previousContainer.SelectedContentIndex = previousContainer.Children.IndexOf( this );
}

parentSide.Children.Remove( parentGroup );
if( parentGroup.Children.Count == 0 )
{
parentSide.Children.Remove( parentGroup );
}

var parent = previousContainer.Parent as LayoutGroupBase;
while( ( parent != null ) )
Expand All @@ -699,8 +699,7 @@ public void ToggleAutoHide()

( ( ILayoutPreviousContainer )newAnchorGroup ).PreviousContainer = parentPane;

foreach( var anchorableToImport in parentPane.Children.ToArray() )
newAnchorGroup.Children.Add( anchorableToImport );
newAnchorGroup.Children.Add( this );

//detect anchor side for the pane
var anchorSide = parentPane.GetSide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

[assembly: AssemblyCompany( "Xceed Software Inc." )]
[assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2020" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2021" )]
[assembly: AssemblyCulture( "" )]


Expand Down
Loading

0 comments on commit 1ed1e41

Please sign in to comment.