Skip to content

Commit

Permalink
V4.0.2 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Jan 7, 2021
1 parent da2776d commit 59dd599
Show file tree
Hide file tree
Showing 94 changed files with 2,354 additions and 1,584 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
CornerRadius="2">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Border>
Expand Down Expand Up @@ -324,7 +323,6 @@
KeyboardNavigation.TabNavigation="Cycle">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
Expand Down Expand Up @@ -509,7 +507,7 @@
HorizontalAlignment="Center"
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
<Image x:Name="PART_ImgHidePin"
Source="Images/PinClose_Dark.png" >
</Image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
Padding="0,1,0,2">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="0,2,0,2"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
Expand Down Expand Up @@ -334,7 +333,6 @@
KeyboardNavigation.TabNavigation="Cycle">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
Expand Down Expand Up @@ -518,7 +516,7 @@
HorizontalAlignment="Center"
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
<Image x:Name="PART_ImgHidePin"
Source="Images/PinClose.png" >
</Image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@
Padding="0,1,0,2">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="0,2,0,2"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
Expand Down Expand Up @@ -417,7 +416,6 @@
KeyboardNavigation.TabNavigation="Cycle">
<ContentPresenter x:Name="PART_SelectedContentHost"
ContentSource="SelectedContent"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
Expand Down Expand Up @@ -605,7 +603,7 @@
HorizontalAlignment="Center"
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
<Image x:Name="PART_ImgHidePin"
Source="Images/PinClose.png" >
</Image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
#region DropTargetType.DocumentPaneDockBottom
{
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockHeight.IsStar )
{
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
}
}
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;

if( parentModel == null )
Expand Down Expand Up @@ -97,6 +107,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
#region DropTargetType.DocumentPaneDockTop
{
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockHeight.IsStar )
{
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
}
}
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;

if( parentModel == null )
Expand Down Expand Up @@ -133,6 +153,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
#region DropTargetType.DocumentPaneDockLeft
{
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockWidth.IsStar )
{
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
}
}
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;

if( parentModel == null )
Expand Down Expand Up @@ -168,6 +198,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
#region DropTargetType.DocumentPaneDockRight
{
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockWidth.IsStar )
{
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
}
}
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;

if( parentModel == null )
Expand Down Expand Up @@ -247,6 +287,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
{
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
var newLayoutDocumentPane = new LayoutDocumentPane();
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockHeight.IsStar )
{
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
}
}

if( parentModel == null )
{
Expand Down Expand Up @@ -286,6 +336,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
{
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
var newLayoutDocumentPane = new LayoutDocumentPane();
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockHeight.IsStar )
{
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
}
}

if( parentModel == null )
{
Expand Down Expand Up @@ -325,6 +385,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
{
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
var newLayoutDocumentPane = new LayoutDocumentPane();
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockWidth.IsStar )
{
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
}
}

if( parentModel == null )
{
Expand Down Expand Up @@ -365,6 +435,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
{
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
var newLayoutDocumentPane = new LayoutDocumentPane();
var targetPane = targetModel as ILayoutPositionableElement;
if( targetPane != null )
{
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
if( targetPane.DockWidth.IsStar )
{
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
}
}

if( parentModel == null )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ private void OnExecuteHideWindowCommand( object parameter )
var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem;
anchorableLayoutItem.HideCommand.Execute( parameter );
}

this.BringFocusOnDockingManager();
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonE
{
base.OnMouseLeftButtonDown( e );

var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
&& this.Model.Root.Manager.Equals(parentDockingManager))
if( e.OriginalSource is Visual )
{
if (!e.Handled && (_model != null) && (_model.SelectedContent != null) )
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
_model.SelectedContent.IsActive = true;
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true;
}
}
}
}
Expand All @@ -97,15 +101,19 @@ protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButton
{
base.OnMouseRightButtonDown( e );

var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
&& this.Model.Root.Manager.Equals(parentDockingManager))
if( e.OriginalSource is Visual )
{
if (!e.Handled && (_model != null) && (_model.SelectedContent != null))
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
_model.SelectedContent.IsActive = true;
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true;
}
}
}
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
***********************************************************************************/


using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Linq;
using Xceed.Wpf.AvalonDock.Layout;

namespace Xceed.Wpf.AvalonDock.Controls
Expand Down Expand Up @@ -96,7 +98,6 @@ protected override void OnSelectionChanged( SelectionChangedEventArgs e )






}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,33 @@ protected override void OnPreviewGotKeyboardFocus( KeyboardFocusChangedEventArgs

protected override void OnPreviewMouseLeftButtonDown( MouseButtonEventArgs e )
{
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
&& this.Model.Root.Manager.Equals(parentDockingManager))
if( e.OriginalSource is Visual )
{
this.SetIsActive();
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
this.SetIsActive();
}
}

base.OnPreviewMouseLeftButtonDown( e );
}

protected override void OnPreviewMouseRightButtonDown( MouseButtonEventArgs e )
{
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
&& this.Model.Root.Manager.Equals(parentDockingManager))
if( e.OriginalSource is Visual )
{
this.SetIsActive();
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
this.SetIsActive();
}
}

base.OnPreviewMouseRightButtonDown( e );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public LayoutItem RootDocumentLayoutItem
{
get
{
if( ( _model == null ) || ( _model.Root == null ) || ( _model.Root.Manager == null ) )
return null;

return _model.Root.Manager.GetLayoutItemFromModel( _model.RootDocument );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,36 @@ protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonE
{
base.OnMouseLeftButtonDown( e );

var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
if( e.OriginalSource is Visual )
{
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
_model.SelectedContent.IsActive = true;
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true;
}
}
}
}
}

protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButtonEventArgs e )
{
base.OnMouseRightButtonDown( e );

var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
if( e.OriginalSource is Visual )
{
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();

if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
{
_model.SelectedContent.IsActive = true;
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
{
_model.SelectedContent.IsActive = true;
}
}
}
}
Expand Down
Loading

0 comments on commit 59dd599

Please sign in to comment.