Skip to content

Commit 1ed1e41

Browse files
committed
V4.1.0 Released
1 parent 61789cf commit 1ed1e41

File tree

461 files changed

+952
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

461 files changed

+952
-622
lines changed

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
3131

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

3636

3737

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
3838
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
3939
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
40+
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />
4041

4142
<DataTemplate x:Key="DocumentPaneControlContentTemplate">
4243
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
@@ -524,6 +525,9 @@
524525
<RotateTransform Angle="90" />
525526
</Setter.Value>
526527
</Setter>
528+
<Setter Property="ToolTip"
529+
TargetName="PART_AutoHidePin"
530+
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
527531
</DataTrigger>
528532
<DataTrigger Binding="{Binding Model.CanClose, RelativeSource={RelativeSource Mode=Self}}"
529533
Value="True">
@@ -979,7 +983,7 @@
979983
Command="{Binding Path=DockCommand}" />
980984
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
981985
Command="{Binding Path=DockAsDocumentCommand}" />
982-
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
986+
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
983987
Command="{Binding Path=AutoHideCommand}" />
984988
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
985989
Command="{Binding Path=CloseCommand}"

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
3131

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

3636

3737

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
3636
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
3737
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
38+
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />
3839

3940
<DataTemplate x:Key="DocumentPaneControlContentTemplate">
4041
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
@@ -533,6 +534,9 @@
533534
<RotateTransform Angle="90" />
534535
</Setter.Value>
535536
</Setter>
537+
<Setter Property="ToolTip"
538+
TargetName="PART_AutoHidePin"
539+
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
536540
</DataTrigger>
537541
<DataTrigger Binding="{Binding Model.CanClose, RelativeSource={RelativeSource Mode=Self}}"
538542
Value="True">
@@ -1002,7 +1006,7 @@
10021006
Command="{Binding Path=DockCommand}" />
10031007
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
10041008
Command="{Binding Path=DockAsDocumentCommand}" />
1005-
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
1009+
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
10061010
Command="{Binding Path=AutoHideCommand}" />
10071011
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
10081012
Command="{Binding Path=CloseCommand}"

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
3131

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

3636

3737
// Setting ComVisible to false makes the types in this assembly not visible

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter" />
3838
<avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter" />
3939
<avalonDockConverters:AnchorableContextMenuHideVisibilityConverter x:Key="AnchorableContextMenuHideVisibilityConverter" />
40+
<avalonDockConverters:AnchorableContextMenuAutoHideHeaderConverter x:Key="AnchorableContextMenuAutoHideHeaderConverter" />
4041

4142
<DataTemplate x:Key="DocumentPaneControlContentTemplate">
4243
<avalonDockControls:LayoutDocumentControl Model="{Binding}" />
@@ -620,6 +621,9 @@
620621
<RotateTransform Angle="90" />
621622
</Setter.Value>
622623
</Setter>
624+
<Setter Property="ToolTip"
625+
TargetName="PART_AutoHidePin"
626+
Value="{x:Static avalonDockProperties:Resources.Window_Restore}" />
623627
</DataTrigger>
624628
<DataTrigger Binding="{Binding Model.IsActive, RelativeSource={RelativeSource Mode=Self}}"
625629
Value="True">
@@ -1099,7 +1103,7 @@
10991103
Command="{Binding Path=DockCommand}" />
11001104
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
11011105
Command="{Binding Path=DockAsDocumentCommand}" />
1102-
<MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
1106+
<MenuItem Header="{Binding LayoutElement.IsAutoHidden, Converter={StaticResource AnchorableContextMenuAutoHideHeaderConverter}}"
11031107
Command="{Binding Path=AutoHideCommand}" />
11041108
<MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
11051109
Command="{Binding Path=CloseCommand}"

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DragService.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,20 @@ internal void Abort()
192192
#region Private Methods
193193

194194
private void GetOverlayWindowHosts()
195-
{
196-
_overlayWindowHosts.AddRange( _manager.GetFloatingWindowsByZOrder().OfType<LayoutAnchorableFloatingWindowControl>().Where( fw => fw != _floatingWindow && fw.IsVisible ) );
197-
_overlayWindowHosts.Add( _manager );
195+
{
196+
var windows = _manager.GetWindowsByZOrder().Where( w => (w != _floatingWindow) && w.IsVisible );
197+
198+
foreach( var w in windows )
199+
{
200+
if( w == Window.GetWindow( _manager ) )
201+
{
202+
_overlayWindowHosts.Add( _manager );
203+
}
204+
else if( w is LayoutAnchorableFloatingWindowControl )
205+
{
206+
_overlayWindowHosts.Add( w as LayoutAnchorableFloatingWindowControl );
207+
}
208+
}
198209
}
199210

200211
#endregion

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropTarget.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ public void Drop( LayoutFloatingWindow floatingWindow )
116116
{
117117
Dispatcher.BeginInvoke( new Action( () =>
118118
{
119-
if( ( currentActiveContent.Root != null ) && ( currentActiveContent.Root.Manager != null ) )
120-
{
121-
currentActiveContent.Root.Manager.MoveFocus( new TraversalRequest( FocusNavigationDirection.Next ) );
122-
}
123119
currentActiveContent.IsSelected = false;
124120
currentActiveContent.IsActive = false;
125121
currentActiveContent.IsActive = true;

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutCachePaneControl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ protected override void OnSelectionChanged( SelectionChangedEventArgs e )
9797

9898

9999

100+
101+
100102

101103

102104

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ internal void BringFocusOnDockingManager()
524524
}
525525
}
526526

527+
internal bool IsClosing()
528+
{
529+
return _isClosing;
530+
}
531+
527532
#endregion
528533

529534
#region Private Methods
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*************************************************************************************
2+
3+
Toolkit for WPF
4+
5+
Copyright (C) 2007-2020 Xceed Software Inc.
6+
7+
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
8+
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
9+
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
10+
11+
For more features, controls, and fast professional support,
12+
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
13+
14+
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
15+
16+
***********************************************************************************/
17+
18+
using System;
19+
using System.Windows.Data;
20+
using System.Globalization;
21+
using Xceed.Wpf.AvalonDock.Properties;
22+
23+
namespace Xceed.Wpf.AvalonDock.Converters
24+
{
25+
public class AnchorableContextMenuAutoHideHeaderConverter : IValueConverter
26+
{
27+
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
28+
{
29+
var isAutoHidden = value as bool?;
30+
31+
return (isAutoHidden != null) && isAutoHidden.Value ? Resources.Window_Restore : Resources.Anchorable_AutoHide;
32+
}
33+
34+
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
35+
{
36+
throw new NotImplementedException();
37+
}
38+
}
39+
}

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public DockingManager()
9797

9898

9999

100+
101+
102+
103+
100104
#region Layout
101105

102106
/// <summary>
@@ -2136,7 +2140,10 @@ internal UIElement CreateUIElementForModel( ILayoutElement model )
21362140

21372141
Dispatcher.BeginInvoke( new Action( () =>
21382142
{
2139-
newFW.Show();
2143+
if( newFW.IsClosing() )
2144+
return;
2145+
2146+
newFW.Show();
21402147

21412148
// Do not set the WindowState before showing or it will be lost
21422149
if( paneForExtensions != null && paneForExtensions.IsMaximized )
@@ -2232,6 +2239,9 @@ internal void StartDraggingFloatingWindowForContent( LayoutContent contentModel,
22322239
{
22332240
Dispatcher.BeginInvoke( new Action( () =>
22342241
{
2242+
if( fwc.IsClosing() )
2243+
return;
2244+
22352245
if( startDrag )
22362246
fwc.AttachDrag();
22372247
fwc.Show();
@@ -2277,6 +2287,41 @@ internal IEnumerable<LayoutFloatingWindowControl> GetFloatingWindowsByZOrder()
22772287
}
22782288
}
22792289

2290+
internal IEnumerable<Window> GetWindowsByZOrder()
2291+
{
2292+
IntPtr windowParentHanlde;
2293+
var parentWindow = Window.GetWindow( this );
2294+
if( parentWindow != null )
2295+
{
2296+
windowParentHanlde = new WindowInteropHelper( parentWindow ).Handle;
2297+
}
2298+
else
2299+
{
2300+
var mainProcess = Process.GetCurrentProcess();
2301+
if( mainProcess == null )
2302+
yield break;
2303+
2304+
windowParentHanlde = mainProcess.MainWindowHandle;
2305+
}
2306+
2307+
IntPtr currentHandle = Win32Helper.GetWindow( windowParentHanlde, ( uint )Win32Helper.GetWindow_Cmd.GW_HWNDFIRST );
2308+
while( currentHandle != IntPtr.Zero )
2309+
{
2310+
if( windowParentHanlde == currentHandle )
2311+
{
2312+
yield return parentWindow;
2313+
}
2314+
else
2315+
{
2316+
LayoutFloatingWindowControl ctrl = _fwList.FirstOrDefault( fw => new WindowInteropHelper( fw ).Handle == currentHandle );
2317+
if( ctrl != null && ctrl.Model.Root.Manager == this )
2318+
yield return ctrl;
2319+
}
2320+
2321+
currentHandle = Win32Helper.GetWindow( currentHandle, ( uint )Win32Helper.GetWindow_Cmd.GW_HWNDNEXT );
2322+
}
2323+
}
2324+
22802325
internal void RemoveFloatingWindow( LayoutFloatingWindowControl floatingWindow )
22812326
{
22822327
_fwList.Remove( floatingWindow );
@@ -3359,21 +3404,25 @@ private void UpdateStarSize( LayoutContent contentModel )
33593404
return;
33603405

33613406
var parentPane = contentModel.Parent as ILayoutPositionableElement;
3362-
if( parentPane != null)
3407+
if( parentPane != null )
33633408
{
3364-
// Reset Dock Size of floating LayoutContent
3365-
if( parentPane.DockWidth.IsStar )
3366-
{
3367-
parentPane.DockWidth = new GridLength( 1d, GridUnitType.Star );
3368-
}
3369-
if( parentPane.DockHeight.IsStar )
3409+
var parentLayoutContainer = parentPane as ILayoutContainer;
3410+
if( ( parentLayoutContainer != null ) && ( parentLayoutContainer.ChildrenCount == 1 ) )
33703411
{
3371-
parentPane.DockHeight = new GridLength( 1d, GridUnitType.Star );
3412+
// Reset Dock Size of floating LayoutContent
3413+
if( parentPane.DockWidth.IsStar )
3414+
{
3415+
parentPane.DockWidth = new GridLength( 1d, GridUnitType.Star );
3416+
}
3417+
if( parentPane.DockHeight.IsStar )
3418+
{
3419+
parentPane.DockHeight = new GridLength( 1d, GridUnitType.Star );
3420+
}
33723421
}
33733422

33743423
var grandParentPaneOrientation = parentPane.Parent as ILayoutOrientableGroup;
33753424
var grandParentPane = parentPane.Parent as ILayoutPositionableElement;
3376-
if( (grandParentPaneOrientation != null) && (grandParentPane != null) )
3425+
if( ( grandParentPaneOrientation != null ) && ( grandParentPane != null ) )
33773426
{
33783427
if( grandParentPaneOrientation.Orientation == Orientation.Horizontal )
33793428
{
@@ -3383,7 +3432,10 @@ private void UpdateStarSize( LayoutContent contentModel )
33833432
var grandParentPaneContainer = parentPane.Parent as ILayoutContainer;
33843433
if( grandParentPaneContainer != null )
33853434
{
3386-
var children = grandParentPaneContainer.Children.Where( child => !child.Equals( parentPane ) ).Cast<ILayoutPositionableElement>().Where( child => child.DockWidth.IsStar );
3435+
var children = grandParentPaneContainer.Children.Where( child => ( child.Equals( parentPane ) && ( parentPane is ILayoutContainer ) && ( ( ( ILayoutContainer )parentPane ).ChildrenCount > 1 ) )
3436+
|| !child.Equals( parentPane ) )
3437+
.Cast<ILayoutPositionableElement>()
3438+
.Where( child => child.DockHeight.IsStar );
33873439
var childrenTotalWidth = children.Sum( child => child.DockWidth.Value );
33883440
foreach( var child in children )
33893441
{
@@ -3400,7 +3452,10 @@ private void UpdateStarSize( LayoutContent contentModel )
34003452
var grandParentPaneContainer = parentPane.Parent as ILayoutContainer;
34013453
if( grandParentPaneContainer != null )
34023454
{
3403-
var children = grandParentPaneContainer.Children.Where( child => !child.Equals( parentPane ) ).Cast<ILayoutPositionableElement>().Where( child => child.DockHeight.IsStar );
3455+
var children = grandParentPaneContainer.Children.Where( child => ( child.Equals( parentPane ) && ( parentPane is ILayoutContainer ) && ( ( ( ILayoutContainer )parentPane ).ChildrenCount > 1 ) )
3456+
|| !child.Equals( parentPane ) )
3457+
.Cast<ILayoutPositionableElement>()
3458+
.Where( child => child.DockHeight.IsStar );
34043459
var childrenTotalHeight = children.Sum( child => child.DockHeight.Value );
34053460
foreach( var child in children )
34063461
{

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -664,18 +664,18 @@ public void ToggleAutoHide()
664664
cnt.PreviousContainer = previousContainer;
665665
}
666666

667-
foreach( var anchorableToToggle in parentGroup.Children.ToArray() )
668-
{
669-
previousContainer.Children.Add( anchorableToToggle );
670-
}
667+
previousContainer.Children.Add( this );
671668

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

678-
parentSide.Children.Remove( parentGroup );
675+
if( parentGroup.Children.Count == 0 )
676+
{
677+
parentSide.Children.Remove( parentGroup );
678+
}
679679

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

700700
( ( ILayoutPreviousContainer )newAnchorGroup ).PreviousContainer = parentPane;
701701

702-
foreach( var anchorableToImport in parentPane.Children.ToArray() )
703-
newAnchorGroup.Children.Add( anchorableToImport );
702+
newAnchorGroup.Children.Add( this );
704703

705704
//detect anchor side for the pane
706705
var anchorSide = parentPane.GetSide();

ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
3131

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

3737

0 commit comments

Comments
 (0)