diff --git a/source/AvalonDock.sln b/source/AvalonDock.sln
index 97fd238c..f9657b75 100644
--- a/source/AvalonDock.sln
+++ b/source/AvalonDock.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2003
+VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonDock.TestApp", "AvalonDock.TestApp\AvalonDock.TestApp.csproj", "{339BC0D5-2A54-40ED-9850-7ED65182E6E1}"
EndProject
@@ -68,16 +68,16 @@ Global
{AB95D11D-7239-4F3D-88FB-278B7C8EB6DF}.Release|x86.Build.0 = Release|x86
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x64.ActiveCfg = Debug|x64
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x64.Build.0 = Debug|x64
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x64.Build.0 = Debug|Any CPU
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x86.ActiveCfg = Debug|Any CPU
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Debug|x86.Build.0 = Debug|Any CPU
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|Any CPU.Build.0 = Release|Any CPU
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x64.ActiveCfg = Release|x64
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x64.Build.0 = Release|x64
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x86.ActiveCfg = Release|x86
- {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x86.Build.0 = Release|x86
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x64.ActiveCfg = Release|Any CPU
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x64.Build.0 = Release|Any CPU
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x86.ActiveCfg = Release|Any CPU
+ {DB81988F-E0F2-45A0-A1FD-8C37F3D35244}.Release|x86.Build.0 = Release|Any CPU
{488DD8F7-9D3C-4F53-BD1F-84A095D9BC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{488DD8F7-9D3C-4F53-BD1F-84A095D9BC10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{488DD8F7-9D3C-4F53-BD1F-84A095D9BC10}.Debug|x64.ActiveCfg = Debug|x64
@@ -92,16 +92,16 @@ Global
{488DD8F7-9D3C-4F53-BD1F-84A095D9BC10}.Release|x86.Build.0 = Release|x86
{89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x64.ActiveCfg = Debug|x64
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x64.Build.0 = Debug|x64
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x86.ActiveCfg = Debug|x64
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x86.Build.0 = Debug|x64
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x64.Build.0 = Debug|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Debug|x86.Build.0 = Debug|Any CPU
{89286EB4-B4A1-418C-839A-067B00F442D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89286EB4-B4A1-418C-839A-067B00F442D8}.Release|Any CPU.Build.0 = Release|Any CPU
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x64.ActiveCfg = Release|x64
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x64.Build.0 = Release|x64
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x86.ActiveCfg = Release|x86
- {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x86.Build.0 = Release|x86
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x64.ActiveCfg = Release|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x64.Build.0 = Release|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x86.ActiveCfg = Release|Any CPU
+ {89286EB4-B4A1-418C-839A-067B00F442D8}.Release|x86.Build.0 = Release|Any CPU
{BD7EEE0E-9432-4E76-BD82-793358E56BDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD7EEE0E-9432-4E76-BD82-793358E56BDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD7EEE0E-9432-4E76-BD82-793358E56BDF}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs
index 04bbed86..6d3eb8a0 100644
--- a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/AssemblyVersionInfo.cs
@@ -21,7 +21,7 @@ This program is provided to you under the terms of the Microsoft Public
internal static class _XceedVersionInfo
{
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
- public const string BaseVersion = "2.3";
+ public const string BaseVersion = "3.3";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";
diff --git a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Properties/AssemblyInfo.cs b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Properties/AssemblyInfo.cs
index 6d82a9ec..4f0eb25b 100644
--- a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Properties/AssemblyInfo.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Properties/AssemblyInfo.cs
@@ -25,12 +25,12 @@ This program is provided to you under the terms of the Microsoft Public
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle( "Xceed Extended WPF Toolkit - AvalonDock Metro Theme" )]
+[assembly: AssemblyTitle( "Xceed Toolkit for WPF - AvalonDock Metro Theme" )]
[assembly: AssemblyDescription( "This assembly implements the Metro Theme for the AvalonDock layout system." )]
[assembly: AssemblyCompany( "Xceed Software Inc." )]
-[assembly: AssemblyProduct( "Xceed Extended WPF Toolkit - AvalonDock" )]
-[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2014" )]
+[assembly: AssemblyProduct( "Xceed Toolkit for WPF - AvalonDock" )]
+[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2007-2017" )]
@@ -64,6 +64,6 @@ This program is provided to you under the terms of the Microsoft Public
#pragma warning disable 1699
[assembly: AssemblyDelaySign( false )]
-////[assembly: AssemblyKeyFile( @"..\..\sn.snk" )]
+[assembly: AssemblyKeyFile( @"..\..\sn.snk" )]
[assembly: AssemblyKeyName( "" )]
#pragma warning restore 1699
diff --git a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml
index 9f2ae367..a1495ea4 100644
--- a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml
+++ b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml
@@ -14,1367 +14,1841 @@
**********************************************************************************-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+ Grid.Column="1"
+ Grid.Row="1" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Xceed.Wpf.AvalonDock.Themes.Metro.csproj b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Xceed.Wpf.AvalonDock.Themes.Metro.csproj
index 673f79b8..73797ddf 100644
--- a/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Xceed.Wpf.AvalonDock.Themes.Metro.csproj
+++ b/source/Components/Xceed.Wpf.AvalonDock.Themes.Metro/Xceed.Wpf.AvalonDock.Themes.Metro.csproj
@@ -33,42 +33,6 @@
prompt
4
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
-
-
- true
- bin\x86\Debug\
- DEBUG;TRACE
- full
- x86
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\x86\Release\
- TRACE
- true
- pdbonly
- x86
- prompt
- MinimumRecommendedRules.ruleset
-
diff --git a/source/Components/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs b/source/Components/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs
index 09b02231..6d3eb8a0 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/AssemblyVersionInfo.cs
@@ -21,7 +21,7 @@ This program is provided to you under the terms of the Microsoft Public
internal static class _XceedVersionInfo
{
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
- public const string BaseVersion = "3.2";
+ public const string BaseVersion = "3.3";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs
index 394717fe..ad2f7390 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs
@@ -15,9 +15,6 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Windows;
using System.Windows.Controls;
using Xceed.Wpf.AvalonDock.Layout;
@@ -25,160 +22,165 @@ This program is provided to you under the terms of the Microsoft Public
namespace Xceed.Wpf.AvalonDock.Controls
{
- public class LayoutAnchorControl : Control, ILayoutControl
+ public class LayoutAnchorControl : Control, ILayoutControl
+ {
+ static LayoutAnchorControl()
{
- static LayoutAnchorControl()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAnchorControl), new FrameworkPropertyMetadata(typeof(LayoutAnchorControl)));
- Control.IsHitTestVisibleProperty.AddOwner(typeof(LayoutAnchorControl), new FrameworkPropertyMetadata(true));
- }
-
-
- internal LayoutAnchorControl(LayoutAnchorable model)
- {
- _model = model;
- _model.IsActiveChanged += new EventHandler(_model_IsActiveChanged);
- _model.IsSelectedChanged += new EventHandler(_model_IsSelectedChanged);
-
- SetSide(_model.FindParent().Side);
- }
-
- void _model_IsSelectedChanged(object sender, EventArgs e)
- {
- if (!_model.IsAutoHidden)
- _model.IsSelectedChanged -= new EventHandler(_model_IsSelectedChanged);
- else if (_model.IsSelected)
- {
- _model.Root.Manager.ShowAutoHideWindow(this);
- _model.IsSelected = false;
- }
- }
-
- void _model_IsActiveChanged(object sender, EventArgs e)
- {
- if (!_model.IsAutoHidden)
- _model.IsActiveChanged -= new EventHandler(_model_IsActiveChanged);
- else if (_model.IsActive)
- _model.Root.Manager.ShowAutoHideWindow(this);
- }
-
- LayoutAnchorable _model;
-
- public ILayoutElement Model
- {
- get { return _model; }
- }
-
- //protected override void OnVisualParentChanged(DependencyObject oldParent)
- //{
- // base.OnVisualParentChanged(oldParent);
-
- // var contentModel = _model;
-
- // if (oldParent != null && contentModel != null && contentModel.Content is UIElement)
- // {
- // var oldParentPaneControl = oldParent.FindVisualAncestor();
- // if (oldParentPaneControl != null)
- // {
- // ((ILogicalChildrenContainer)oldParentPaneControl).InternalRemoveLogicalChild(contentModel.Content);
- // }
- // }
-
- // if (contentModel.Content != null && contentModel.Content is UIElement)
- // {
- // var oldLogicalParentPaneControl = LogicalTreeHelper.GetParent(contentModel.Content as UIElement)
- // as ILogicalChildrenContainer;
- // if (oldLogicalParentPaneControl != null)
- // oldLogicalParentPaneControl.InternalRemoveLogicalChild(contentModel.Content);
- // }
-
- // if (contentModel != null && contentModel.Content != null && contentModel.Root != null && contentModel.Content is UIElement)
- // {
- // ((ILogicalChildrenContainer)contentModel.Root.Manager).InternalAddLogicalChild(contentModel.Content);
- // }
- //}
-
-
- protected override void OnMouseDown(System.Windows.Input.MouseButtonEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (!e.Handled)
- {
- _model.Root.Manager.ShowAutoHideWindow(this);
- _model.IsActive = true;
- }
- }
-
-
- DispatcherTimer _openUpTimer = null;
-
- protected override void OnMouseEnter(System.Windows.Input.MouseEventArgs e)
- {
- base.OnMouseEnter(e);
-
- if (!e.Handled)
- {
- _openUpTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle);
- _openUpTimer.Interval = TimeSpan.FromMilliseconds(400);
- _openUpTimer.Tick += new EventHandler(_openUpTimer_Tick);
- _openUpTimer.Start();
- }
- }
-
- void _openUpTimer_Tick(object sender, EventArgs e)
- {
- _openUpTimer.Tick -= new EventHandler(_openUpTimer_Tick);
- _openUpTimer.Stop();
- _openUpTimer = null;
- _model.Root.Manager.ShowAutoHideWindow(this);
- }
-
- protected override void OnMouseLeave(System.Windows.Input.MouseEventArgs e)
- {
- if (_openUpTimer != null)
- {
- _openUpTimer.Tick -= new EventHandler(_openUpTimer_Tick);
- _openUpTimer.Stop();
- _openUpTimer = null;
- }
- base.OnMouseLeave(e);
- }
-
-
- #region Side
-
- ///
- /// Side Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey SidePropertyKey
- = DependencyProperty.RegisterReadOnly("Side", typeof(AnchorSide), typeof(LayoutAnchorControl),
- new FrameworkPropertyMetadata((AnchorSide)AnchorSide.Left));
-
- public static readonly DependencyProperty SideProperty
- = SidePropertyKey.DependencyProperty;
-
- ///
- /// Gets the Side property. This dependency property
- /// indicates the anchor side of the control.
- ///
- public AnchorSide Side
- {
- get { return (AnchorSide)GetValue(SideProperty); }
- }
-
- ///
- /// Provides a secure method for setting the Side property.
- /// This dependency property indicates the anchor side of the control.
- ///
- /// The new value for the property.
- protected void SetSide(AnchorSide value)
- {
- SetValue(SidePropertyKey, value);
- }
-
- #endregion
+ DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAnchorControl ), new FrameworkPropertyMetadata( typeof( LayoutAnchorControl ) ) );
+ Control.IsHitTestVisibleProperty.AddOwner( typeof( LayoutAnchorControl ), new FrameworkPropertyMetadata( true ) );
+ }
+
+
+ internal LayoutAnchorControl( LayoutAnchorable model )
+ {
+ _model = model;
+ _model.IsActiveChanged += new EventHandler( _model_IsActiveChanged );
+ _model.IsSelectedChanged += new EventHandler( _model_IsSelectedChanged );
+
+ SetSide( _model.FindParent().Side );
+ }
+
+ void _model_IsSelectedChanged( object sender, EventArgs e )
+ {
+ if( !_model.IsAutoHidden )
+ _model.IsSelectedChanged -= new EventHandler( _model_IsSelectedChanged );
+ else if( _model.IsSelected )
+ {
+ _model.Root.Manager.ShowAutoHideWindow( this );
+ _model.IsSelected = false;
+ }
+ }
+
+ void _model_IsActiveChanged( object sender, EventArgs e )
+ {
+ if( !_model.IsAutoHidden )
+ _model.IsActiveChanged -= new EventHandler( _model_IsActiveChanged );
+ else if( _model.IsActive )
+ _model.Root.Manager.ShowAutoHideWindow( this );
+ }
+
+ LayoutAnchorable _model;
+
+ public ILayoutElement Model
+ {
+ get
+ {
+ return _model;
+ }
+ }
+
+ //protected override void OnVisualParentChanged(DependencyObject oldParent)
+ //{
+ // base.OnVisualParentChanged(oldParent);
+
+ // var contentModel = _model;
+
+ // if (oldParent != null && contentModel != null && contentModel.Content is UIElement)
+ // {
+ // var oldParentPaneControl = oldParent.FindVisualAncestor();
+ // if (oldParentPaneControl != null)
+ // {
+ // ((ILogicalChildrenContainer)oldParentPaneControl).InternalRemoveLogicalChild(contentModel.Content);
+ // }
+ // }
+
+ // if (contentModel.Content != null && contentModel.Content is UIElement)
+ // {
+ // var oldLogicalParentPaneControl = LogicalTreeHelper.GetParent(contentModel.Content as UIElement)
+ // as ILogicalChildrenContainer;
+ // if (oldLogicalParentPaneControl != null)
+ // oldLogicalParentPaneControl.InternalRemoveLogicalChild(contentModel.Content);
+ // }
+
+ // if (contentModel != null && contentModel.Content != null && contentModel.Root != null && contentModel.Content is UIElement)
+ // {
+ // ((ILogicalChildrenContainer)contentModel.Root.Manager).InternalAddLogicalChild(contentModel.Content);
+ // }
+ //}
+
+
+ protected override void OnMouseDown( System.Windows.Input.MouseButtonEventArgs e )
+ {
+ base.OnMouseDown( e );
+
+ if( !e.Handled )
+ {
+ _model.Root.Manager.ShowAutoHideWindow( this );
+ _model.IsActive = true;
+ }
+ }
+ DispatcherTimer _openUpTimer = null;
+
+ protected override void OnMouseEnter( System.Windows.Input.MouseEventArgs e )
+ {
+ base.OnMouseEnter( e );
+
+ if( !e.Handled )
+ {
+ _openUpTimer = new DispatcherTimer( DispatcherPriority.ApplicationIdle );
+ _openUpTimer.Interval = TimeSpan.FromMilliseconds( 400 );
+ _openUpTimer.Tick += new EventHandler( _openUpTimer_Tick );
+ _openUpTimer.Start();
+ }
+ }
+
+ void _openUpTimer_Tick( object sender, EventArgs e )
+ {
+ _openUpTimer.Tick -= new EventHandler( _openUpTimer_Tick );
+ _openUpTimer.Stop();
+ _openUpTimer = null;
+ _model.Root.Manager.ShowAutoHideWindow( this );
+ }
+
+ protected override void OnMouseLeave( System.Windows.Input.MouseEventArgs e )
+ {
+ if( _openUpTimer != null )
+ {
+ _openUpTimer.Tick -= new EventHandler( _openUpTimer_Tick );
+ _openUpTimer.Stop();
+ _openUpTimer = null;
+ }
+ base.OnMouseLeave( e );
+ }
+
+
+ #region Side
+
+ ///
+ /// Side Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey SidePropertyKey
+ = DependencyProperty.RegisterReadOnly( "Side", typeof( AnchorSide ), typeof( LayoutAnchorControl ),
+ new FrameworkPropertyMetadata( ( AnchorSide )AnchorSide.Left ) );
+
+ public static readonly DependencyProperty SideProperty
+ = SidePropertyKey.DependencyProperty;
+
+ ///
+ /// Gets the Side property. This dependency property
+ /// indicates the anchor side of the control.
+ ///
+ public AnchorSide Side
+ {
+ get
+ {
+ return ( AnchorSide )GetValue( SideProperty );
+ }
}
+
+ ///
+ /// Provides a secure method for setting the Side property.
+ /// This dependency property indicates the anchor side of the control.
+ ///
+ /// The new value for the property.
+ protected void SetSide( AnchorSide value )
+ {
+ SetValue( SidePropertyKey, value );
+ }
+
+ #endregion
+
+ }
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorSideControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorSideControl.cs
index 6357d084..238fa6c5 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorSideControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorSideControl.cs
@@ -15,9 +15,7 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/
using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Collections.ObjectModel;
@@ -25,228 +23,245 @@ This program is provided to you under the terms of the Microsoft Public
namespace Xceed.Wpf.AvalonDock.Controls
{
- public class LayoutAnchorSideControl : Control, ILayoutControl
+ public class LayoutAnchorSideControl : Control, ILayoutControl
+ {
+ static LayoutAnchorSideControl()
{
- static LayoutAnchorSideControl()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAnchorSideControl), new FrameworkPropertyMetadata(typeof(LayoutAnchorSideControl)));
- }
-
+ DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAnchorSideControl ), new FrameworkPropertyMetadata( typeof( LayoutAnchorSideControl ) ) );
+ }
- internal LayoutAnchorSideControl(LayoutAnchorSide model)
- {
- if (model == null)
- throw new ArgumentNullException("model");
+ internal LayoutAnchorSideControl( LayoutAnchorSide model )
+ {
+ if( model == null )
+ throw new ArgumentNullException( "model" );
- _model = model;
- CreateChildrenViews();
+ _model = model;
- _model.Children.CollectionChanged += (s, e) => OnModelChildrenCollectionChanged(e);
+ CreateChildrenViews();
- UpdateSide();
- }
+ _model.Children.CollectionChanged += ( s, e ) => OnModelChildrenCollectionChanged( e );
- private void CreateChildrenViews()
- {
- var manager = _model.Root.Manager;
- foreach (var childModel in _model.Children)
- {
- _childViews.Add(manager.CreateUIElementForModel(childModel) as LayoutAnchorGroupControl);
- }
- }
+ UpdateSide();
+ }
- private void OnModelChildrenCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
- {
- if (e.OldItems != null &&
- (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove ||
- e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace))
- {
- foreach (var childModel in e.OldItems)
- _childViews.Remove(_childViews.First(cv => cv.Model == childModel));
- }
-
- if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
- _childViews.Clear();
-
- if (e.NewItems != null &&
- (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add ||
- e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace))
- {
- var manager = _model.Root.Manager;
- int insertIndex = e.NewStartingIndex;
- foreach (LayoutAnchorGroup childModel in e.NewItems)
- {
- _childViews.Insert(insertIndex++, manager.CreateUIElementForModel(childModel) as LayoutAnchorGroupControl);
- }
- }
- }
+ private void CreateChildrenViews()
+ {
+ var manager = _model.Root.Manager;
+ foreach( var childModel in _model.Children )
+ {
+ _childViews.Add( manager.CreateUIElementForModel( childModel ) as LayoutAnchorGroupControl );
+ }
+ }
- LayoutAnchorSide _model = null;
- public ILayoutElement Model
+ private void OnModelChildrenCollectionChanged( System.Collections.Specialized.NotifyCollectionChangedEventArgs e )
+ {
+ if( e.OldItems != null &&
+ ( e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove ||
+ e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace ) )
+ {
+ foreach( var childModel in e.OldItems )
+ _childViews.Remove( _childViews.First( cv => cv.Model == childModel ) );
+ }
+
+ if( e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset )
+ _childViews.Clear();
+
+ if( e.NewItems != null &&
+ ( e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add ||
+ e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace ) )
+ {
+ var manager = _model.Root.Manager;
+ int insertIndex = e.NewStartingIndex;
+ foreach( LayoutAnchorGroup childModel in e.NewItems )
{
- get { return _model; }
+ _childViews.Insert( insertIndex++, manager.CreateUIElementForModel( childModel ) as LayoutAnchorGroupControl );
}
+ }
+ }
- ObservableCollection _childViews = new ObservableCollection();
+ LayoutAnchorSide _model = null;
+ public ILayoutElement Model
+ {
+ get
+ {
+ return _model;
+ }
+ }
- public ObservableCollection Children
- {
- get { return _childViews; }
- }
+ ObservableCollection _childViews = new ObservableCollection();
- void UpdateSide()
- {
- switch (_model.Side)
- {
- case AnchorSide.Left:
- SetIsLeftSide(true);
- break;
- case AnchorSide.Top:
- SetIsTopSide(true);
- break;
- case AnchorSide.Right:
- SetIsRightSide(true);
- break;
- case AnchorSide.Bottom:
- SetIsBottomSide(true);
- break;
- }
- }
+ public ObservableCollection Children
+ {
+ get
+ {
+ return _childViews;
+ }
+ }
- #region IsLeftSide
+ void UpdateSide()
+ {
+ switch( _model.Side )
+ {
+ case AnchorSide.Left:
+ SetIsLeftSide( true );
+ break;
+ case AnchorSide.Top:
+ SetIsTopSide( true );
+ break;
+ case AnchorSide.Right:
+ SetIsRightSide( true );
+ break;
+ case AnchorSide.Bottom:
+ SetIsBottomSide( true );
+ break;
+ }
+ }
- ///
- /// IsLeftSide Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey IsLeftSidePropertyKey
- = DependencyProperty.RegisterReadOnly("IsLeftSide", typeof(bool), typeof(LayoutAnchorSideControl),
- new FrameworkPropertyMetadata((bool)false));
+ #region IsLeftSide
- public static readonly DependencyProperty IsLeftSideProperty
- = IsLeftSidePropertyKey.DependencyProperty;
+ ///
+ /// IsLeftSide Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey IsLeftSidePropertyKey
+ = DependencyProperty.RegisterReadOnly( "IsLeftSide", typeof( bool ), typeof( LayoutAnchorSideControl ),
+ new FrameworkPropertyMetadata( ( bool )false ) );
- ///
- /// Gets the IsLeftSide property. This dependency property
- /// indicates this control is anchored to left side.
- ///
- public bool IsLeftSide
- {
- get { return (bool)GetValue(IsLeftSideProperty); }
- }
+ public static readonly DependencyProperty IsLeftSideProperty
+ = IsLeftSidePropertyKey.DependencyProperty;
- ///
- /// Provides a secure method for setting the IsLeftSide property.
- /// This dependency property indicates this control is anchored to left side.
- ///
- /// The new value for the property.
- protected void SetIsLeftSide(bool value)
- {
- SetValue(IsLeftSidePropertyKey, value);
- }
+ ///
+ /// Gets the IsLeftSide property. This dependency property
+ /// indicates this control is anchored to left side.
+ ///
+ public bool IsLeftSide
+ {
+ get
+ {
+ return ( bool )GetValue( IsLeftSideProperty );
+ }
+ }
- #endregion
+ ///
+ /// Provides a secure method for setting the IsLeftSide property.
+ /// This dependency property indicates this control is anchored to left side.
+ ///
+ /// The new value for the property.
+ protected void SetIsLeftSide( bool value )
+ {
+ SetValue( IsLeftSidePropertyKey, value );
+ }
- #region IsTopSide
+ #endregion
- ///
- /// IsTopSide Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey IsTopSidePropertyKey
- = DependencyProperty.RegisterReadOnly("IsTopSide", typeof(bool), typeof(LayoutAnchorSideControl),
- new FrameworkPropertyMetadata((bool)false));
+ #region IsTopSide
- public static readonly DependencyProperty IsTopSideProperty
- = IsTopSidePropertyKey.DependencyProperty;
+ ///
+ /// IsTopSide Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey IsTopSidePropertyKey
+ = DependencyProperty.RegisterReadOnly( "IsTopSide", typeof( bool ), typeof( LayoutAnchorSideControl ),
+ new FrameworkPropertyMetadata( ( bool )false ) );
- ///
- /// Gets the IsTopSide property. This dependency property
- /// indicates this control is anchored to top side.
- ///
- public bool IsTopSide
- {
- get { return (bool)GetValue(IsTopSideProperty); }
- }
+ public static readonly DependencyProperty IsTopSideProperty
+ = IsTopSidePropertyKey.DependencyProperty;
- ///
- /// Provides a secure method for setting the IsTopSide property.
- /// This dependency property indicates this control is anchored to top side.
- ///
- /// The new value for the property.
- protected void SetIsTopSide(bool value)
- {
- SetValue(IsTopSidePropertyKey, value);
- }
+ ///
+ /// Gets the IsTopSide property. This dependency property
+ /// indicates this control is anchored to top side.
+ ///
+ public bool IsTopSide
+ {
+ get
+ {
+ return ( bool )GetValue( IsTopSideProperty );
+ }
+ }
- #endregion
+ ///
+ /// Provides a secure method for setting the IsTopSide property.
+ /// This dependency property indicates this control is anchored to top side.
+ ///
+ /// The new value for the property.
+ protected void SetIsTopSide( bool value )
+ {
+ SetValue( IsTopSidePropertyKey, value );
+ }
- #region IsRightSide
+ #endregion
- ///
- /// IsRightSide Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey IsRightSidePropertyKey
- = DependencyProperty.RegisterReadOnly("IsRightSide", typeof(bool), typeof(LayoutAnchorSideControl),
- new FrameworkPropertyMetadata((bool)false));
+ #region IsRightSide
- public static readonly DependencyProperty IsRightSideProperty
- = IsRightSidePropertyKey.DependencyProperty;
+ ///
+ /// IsRightSide Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey IsRightSidePropertyKey
+ = DependencyProperty.RegisterReadOnly( "IsRightSide", typeof( bool ), typeof( LayoutAnchorSideControl ),
+ new FrameworkPropertyMetadata( ( bool )false ) );
- ///
- /// Gets the IsRightSide property. This dependency property
- /// indicates this control is anchored to right side.
- ///
- public bool IsRightSide
- {
- get { return (bool)GetValue(IsRightSideProperty); }
- }
+ public static readonly DependencyProperty IsRightSideProperty
+ = IsRightSidePropertyKey.DependencyProperty;
- ///
- /// Provides a secure method for setting the IsRightSide property.
- /// This dependency property indicates this control is anchored to right side.
- ///
- /// The new value for the property.
- protected void SetIsRightSide(bool value)
- {
- SetValue(IsRightSidePropertyKey, value);
- }
+ ///
+ /// Gets the IsRightSide property. This dependency property
+ /// indicates this control is anchored to right side.
+ ///
+ public bool IsRightSide
+ {
+ get
+ {
+ return ( bool )GetValue( IsRightSideProperty );
+ }
+ }
- #endregion
+ ///
+ /// Provides a secure method for setting the IsRightSide property.
+ /// This dependency property indicates this control is anchored to right side.
+ ///
+ /// The new value for the property.
+ protected void SetIsRightSide( bool value )
+ {
+ SetValue( IsRightSidePropertyKey, value );
+ }
- #region IsBottomSide
+ #endregion
- ///
- /// IsBottomSide Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey IsBottomSidePropertyKey
- = DependencyProperty.RegisterReadOnly("IsBottomSide", typeof(bool), typeof(LayoutAnchorSideControl),
- new FrameworkPropertyMetadata((bool)false));
+ #region IsBottomSide
- public static readonly DependencyProperty IsBottomSideProperty
- = IsBottomSidePropertyKey.DependencyProperty;
+ ///
+ /// IsBottomSide Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey IsBottomSidePropertyKey
+ = DependencyProperty.RegisterReadOnly( "IsBottomSide", typeof( bool ), typeof( LayoutAnchorSideControl ),
+ new FrameworkPropertyMetadata( ( bool )false ) );
- ///
- /// Gets the IsBottomSide property. This dependency property
- /// indicates if this panel is anchored to bottom side.
- ///
- public bool IsBottomSide
- {
- get { return (bool)GetValue(IsBottomSideProperty); }
- }
+ public static readonly DependencyProperty IsBottomSideProperty
+ = IsBottomSidePropertyKey.DependencyProperty;
- ///
- /// Provides a secure method for setting the IsBottomSide property.
- /// This dependency property indicates if this panel is anchored to bottom side.
- ///
- /// The new value for the property.
- protected void SetIsBottomSide(bool value)
- {
- SetValue(IsBottomSidePropertyKey, value);
- }
+ ///
+ /// Gets the IsBottomSide property. This dependency property
+ /// indicates if this panel is anchored to bottom side.
+ ///
+ public bool IsBottomSide
+ {
+ get
+ {
+ return ( bool )GetValue( IsBottomSideProperty );
+ }
+ }
- #endregion
+ ///
+ /// Provides a secure method for setting the IsBottomSide property.
+ /// This dependency property indicates if this panel is anchored to bottom side.
+ ///
+ /// The new value for the property.
+ protected void SetIsBottomSide( bool value )
+ {
+ SetValue( IsBottomSidePropertyKey, value );
+ }
+ #endregion
- }
+ }
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs
index 17735aa3..8ce216b8 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs
@@ -14,147 +14,144 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
using Xceed.Wpf.AvalonDock.Layout;
namespace Xceed.Wpf.AvalonDock.Controls
{
- public class LayoutAnchorableControl : Control
+ public class LayoutAnchorableControl : Control
+ {
+ static LayoutAnchorableControl()
{
- static LayoutAnchorableControl()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAnchorableControl), new FrameworkPropertyMetadata(typeof(LayoutAnchorableControl)));
- FocusableProperty.OverrideMetadata(typeof(LayoutAnchorableControl), new FrameworkPropertyMetadata(false));
- }
-
- public LayoutAnchorableControl()
- {
- //SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this });
- }
+ DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAnchorableControl ), new FrameworkPropertyMetadata( typeof( LayoutAnchorableControl ) ) );
+ FocusableProperty.OverrideMetadata( typeof( LayoutAnchorableControl ), new FrameworkPropertyMetadata( false ) );
+ }
+ public LayoutAnchorableControl()
+ {
+ //SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this });
+ }
- #region Model
- ///
- /// Model Dependency Property
- ///
- public static readonly DependencyProperty ModelProperty =
- DependencyProperty.Register("Model", typeof(LayoutAnchorable), typeof(LayoutAnchorableControl),
- new FrameworkPropertyMetadata((LayoutAnchorable)null,
- new PropertyChangedCallback(OnModelChanged)));
+ #region Model
- ///
- /// Gets or sets the Model property. This dependency property
- /// indicates the model attached to this view.
- ///
- public LayoutAnchorable Model
- {
- get { return (LayoutAnchorable)GetValue(ModelProperty); }
- set { SetValue(ModelProperty, value); }
- }
+ ///
+ /// Model Dependency Property
+ ///
+ public static readonly DependencyProperty ModelProperty =
+ DependencyProperty.Register( "Model", typeof( LayoutAnchorable ), typeof( LayoutAnchorableControl ),
+ new FrameworkPropertyMetadata( ( LayoutAnchorable )null,
+ new PropertyChangedCallback( OnModelChanged ) ) );
- ///
- /// Handles changes to the Model property.
- ///
- private static void OnModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- ((LayoutAnchorableControl)d).OnModelChanged(e);
- }
+ ///
+ /// Gets or sets the Model property. This dependency property
+ /// indicates the model attached to this view.
+ ///
+ public LayoutAnchorable Model
+ {
+ get
+ {
+ return ( LayoutAnchorable )GetValue( ModelProperty );
+ }
+ set
+ {
+ SetValue( ModelProperty, value );
+ }
+ }
- ///
- /// Provides derived classes an opportunity to handle changes to the Model property.
- ///
- protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)
- {
- if( e.OldValue != null )
- {
- ((LayoutContent)e.OldValue).PropertyChanged -= Model_PropertyChanged;
- }
+ ///
+ /// Handles changes to the Model property.
+ ///
+ private static void OnModelChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
+ {
+ ( ( LayoutAnchorableControl )d ).OnModelChanged( e );
+ }
- if( Model != null )
- {
- Model.PropertyChanged += Model_PropertyChanged;
- SetLayoutItem( Model.Root.Manager.GetLayoutItemFromModel( Model ) );
- }
- else
- SetLayoutItem( null );
- }
+ ///
+ /// Provides derived classes an opportunity to handle changes to the Model property.
+ ///
+ protected virtual void OnModelChanged( DependencyPropertyChangedEventArgs e )
+ {
+ if( e.OldValue != null )
+ {
+ ( ( LayoutContent )e.OldValue ).PropertyChanged -= Model_PropertyChanged;
+ }
+
+ if( Model != null )
+ {
+ Model.PropertyChanged += Model_PropertyChanged;
+ SetLayoutItem( Model.Root.Manager.GetLayoutItemFromModel( Model ) );
+ }
+ else
+ SetLayoutItem( null );
+ }
- private void Model_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )
+ private void Model_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )
+ {
+ if( e.PropertyName == "IsEnabled" )
+ {
+ if( Model != null )
{
- if( e.PropertyName == "IsEnabled" )
+ IsEnabled = Model.IsEnabled;
+ if( !IsEnabled && Model.IsActive )
{
- if( Model != null )
+ if( ( Model.Parent != null ) && ( Model.Parent is LayoutAnchorablePane ) )
{
- IsEnabled = Model.IsEnabled;
- if( !IsEnabled && Model.IsActive )
- {
- if( (Model.Parent != null) && (Model.Parent is LayoutAnchorablePane) )
- {
- ((LayoutAnchorablePane)Model.Parent).SetNextSelectedIndex();
- }
- }
+ ( ( LayoutAnchorablePane )Model.Parent ).SetNextSelectedIndex();
}
}
}
+ }
+ }
- #endregion
+ #endregion
- #region LayoutItem
+ #region LayoutItem
- ///
- /// LayoutItem Read-Only Dependency Property
- ///
- private static readonly DependencyPropertyKey LayoutItemPropertyKey
- = DependencyProperty.RegisterReadOnly("LayoutItem", typeof(LayoutItem), typeof(LayoutAnchorableControl),
- new FrameworkPropertyMetadata((LayoutItem)null));
+ ///
+ /// LayoutItem Read-Only Dependency Property
+ ///
+ private static readonly DependencyPropertyKey LayoutItemPropertyKey
+ = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( LayoutAnchorableControl ),
+ new FrameworkPropertyMetadata( ( LayoutItem )null ) );
- public static readonly DependencyProperty LayoutItemProperty
- = LayoutItemPropertyKey.DependencyProperty;
+ public static readonly DependencyProperty LayoutItemProperty
+ = LayoutItemPropertyKey.DependencyProperty;
- ///
- /// Gets the LayoutItem property. This dependency property
- /// indicates the LayoutItem attached to this tag item.
- ///
- public LayoutItem LayoutItem
- {
- get { return (LayoutItem)GetValue(LayoutItemProperty); }
- }
-
- ///
- /// Provides a secure method for setting the LayoutItem property.
- /// This dependency property indicates the LayoutItem attached to this tag item.
- ///
- /// The new value for the property.
- protected void SetLayoutItem(LayoutItem value)
- {
- SetValue(LayoutItemPropertyKey, value);
- }
+ ///
+ /// Gets the LayoutItem property. This dependency property
+ /// indicates the LayoutItem attached to this tag item.
+ ///
+ public LayoutItem LayoutItem
+ {
+ get
+ {
+ return ( LayoutItem )GetValue( LayoutItemProperty );
+ }
+ }
- #endregion
+ ///
+ /// Provides a secure method for setting the LayoutItem property.
+ /// This dependency property indicates the LayoutItem attached to this tag item.
+ ///
+ /// The new value for the property.
+ protected void SetLayoutItem( LayoutItem value )
+ {
+ SetValue( LayoutItemPropertyKey, value );
+ }
+ #endregion
- protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e)
- {
- if (Model != null)
- Model.IsActive = true;
- base.OnGotKeyboardFocus(e);
- }
+ protected override void OnGotKeyboardFocus( System.Windows.Input.KeyboardFocusChangedEventArgs e )
+ {
+ if( Model != null )
+ Model.IsActive = true;
+ base.OnGotKeyboardFocus( e );
+ }
- }
+ }
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
index a1fafcc6..7b470c86 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
@@ -47,6 +47,7 @@ internal LayoutAnchorableFloatingWindowControl( LayoutAnchorableFloatingWindow m
{
_model = model;
HideWindowCommand = new RelayCommand( ( p ) => OnExecuteHideWindowCommand( p ), ( p ) => CanExecuteHideWindowCommand( p ) );
+ CloseWindowCommand = new RelayCommand( ( p ) => OnExecuteCloseWindowCommand( p ), ( p ) => CanExecuteCloseWindowCommand( p ) );
UpdateThemeResources();
}
@@ -362,5 +363,60 @@ private void OnExecuteHideWindowCommand( object parameter )
}
}
#endregion
+
+ #region CloseWindowCommand
+ public ICommand CloseWindowCommand
+ {
+ get;
+ private set;
+ }
+
+ private bool CanExecuteCloseWindowCommand( object parameter )
+ {
+ if( Model == null )
+ return false;
+
+ var root = Model.Root;
+ if( root == null )
+ return false;
+
+ var manager = root.Manager;
+ if( manager == null )
+ return false;
+
+ bool canExecute = false;
+ foreach( var anchorable in this.Model.Descendents().OfType().ToArray() )
+ {
+ if( !anchorable.CanClose )
+ {
+ canExecute = false;
+ break;
+ }
+
+ var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem;
+ if( anchorableLayoutItem == null ||
+ anchorableLayoutItem.CloseCommand == null ||
+ !anchorableLayoutItem.CloseCommand.CanExecute( parameter ) )
+ {
+ canExecute = false;
+ break;
+ }
+
+ canExecute = true;
+ }
+
+ return canExecute;
+ }
+
+ private void OnExecuteCloseWindowCommand( object parameter )
+ {
+ var manager = Model.Root.Manager;
+ foreach( var anchorable in this.Model.Descendents().OfType().ToArray() )
+ {
+ var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem;
+ anchorableLayoutItem.CloseCommand.Execute( parameter );
+ }
+ }
+ #endregion
}
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs
index 7d7ac237..e41b1465 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorablePaneControl.cs
@@ -15,10 +15,6 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Data;
@@ -94,5 +90,4 @@ protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButton
}
}
-
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs
index c059d558..673a1b2d 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs
@@ -15,9 +15,7 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/
using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Windows.Interop;
using System.Windows.Controls;
using System.Runtime.InteropServices;
@@ -26,526 +24,542 @@ This program is provided to you under the terms of the Microsoft Public
using System.Windows.Data;
using System.Windows.Media;
using Xceed.Wpf.AvalonDock.Layout;
-using System.Diagnostics;
-using System.Windows.Threading;
namespace Xceed.Wpf.AvalonDock.Controls
{
- public class LayoutAutoHideWindowControl : HwndHost, ILayoutControl
+ public class LayoutAutoHideWindowControl : HwndHost, ILayoutControl
+ {
+ static LayoutAutoHideWindowControl()
{
- static LayoutAutoHideWindowControl()
- {
- DefaultStyleKeyProperty.OverrideMetadata(typeof(LayoutAutoHideWindowControl), new FrameworkPropertyMetadata(typeof(LayoutAutoHideWindowControl)));
- UIElement.FocusableProperty.OverrideMetadata(typeof(LayoutAutoHideWindowControl), new FrameworkPropertyMetadata(true));
- Control.IsTabStopProperty.OverrideMetadata(typeof(LayoutAutoHideWindowControl), new FrameworkPropertyMetadata(true));
- VisibilityProperty.OverrideMetadata(typeof(LayoutAutoHideWindowControl), new FrameworkPropertyMetadata(Visibility.Hidden));
- }
+ DefaultStyleKeyProperty.OverrideMetadata( typeof( LayoutAutoHideWindowControl ), new FrameworkPropertyMetadata( typeof( LayoutAutoHideWindowControl ) ) );
+ UIElement.FocusableProperty.OverrideMetadata( typeof( LayoutAutoHideWindowControl ), new FrameworkPropertyMetadata( true ) );
+ Control.IsTabStopProperty.OverrideMetadata( typeof( LayoutAutoHideWindowControl ), new FrameworkPropertyMetadata( true ) );
+ VisibilityProperty.OverrideMetadata( typeof( LayoutAutoHideWindowControl ), new FrameworkPropertyMetadata( Visibility.Hidden ) );
+ }
- internal LayoutAutoHideWindowControl()
- {
- }
+ internal LayoutAutoHideWindowControl()
+ {
+ }
- internal void Show(LayoutAnchorControl anchor)
- {
- if (_model != null)
- throw new InvalidOperationException();
+ internal void Show( LayoutAnchorControl anchor )
+ {
+ if( _model != null )
+ throw new InvalidOperationException();
- _anchor = anchor;
- _model = anchor.Model as LayoutAnchorable;
- _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side;
- _manager = _model.Root.Manager;
- CreateInternalGrid();
+ _anchor = anchor;
+ _model = anchor.Model as LayoutAnchorable;
+ _side = ( anchor.Model.Parent.Parent as LayoutAnchorSide ).Side;
+ _manager = _model.Root.Manager;
+ CreateInternalGrid();
- _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged);
+ _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler( _model_PropertyChanged );
- Visibility = System.Windows.Visibility.Visible;
- InvalidateMeasure();
- UpdateWindowPos();
- }
+ Visibility = System.Windows.Visibility.Visible;
+ InvalidateMeasure();
+ UpdateWindowPos();
+ }
- internal void Hide()
- {
- if (_model == null)
- return;
+ internal void Hide()
+ {
+ if( _model == null )
+ return;
- _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged);
+ _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler( _model_PropertyChanged );
- RemoveInternalGrid();
- _anchor = null;
- _model = null;
- _manager = null;
- Visibility = System.Windows.Visibility.Hidden;
- }
+ RemoveInternalGrid();
+ _anchor = null;
+ _model = null;
+ _manager = null;
+ Visibility = System.Windows.Visibility.Hidden;
+ }
- LayoutAnchorControl _anchor;
+ LayoutAnchorControl _anchor;
- LayoutAnchorable _model;
+ LayoutAnchorable _model;
- public ILayoutElement Model
- {
- get { return _model; }
- }
+ public ILayoutElement Model
+ {
+ get
+ {
+ return _model;
+ }
+ }
- HwndSource _internalHwndSource = null;
- IntPtr parentWindowHandle;
- protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(System.Runtime.InteropServices.HandleRef hwndParent)
- {
- parentWindowHandle = hwndParent.Handle;
- _internalHwndSource = new HwndSource(new HwndSourceParameters()
- {
- ParentWindow = hwndParent.Handle,
- WindowStyle = Win32Helper.WS_CHILD | Win32Helper.WS_VISIBLE | Win32Helper.WS_CLIPSIBLINGS | Win32Helper.WS_CLIPCHILDREN,
- Width = 0,
- Height = 0,
- });
-
- _internalHost_ContentRendered = false;
- _internalHwndSource.ContentRendered += _internalHwndSource_ContentRendered;
- _internalHwndSource.RootVisual = _internalHostPresenter;
- AddLogicalChild(_internalHostPresenter);
- Win32Helper.BringWindowToTop(_internalHwndSource.Handle);
- return new HandleRef(this, _internalHwndSource.Handle);
- }
+ HwndSource _internalHwndSource = null;
+ IntPtr parentWindowHandle;
+ protected override System.Runtime.InteropServices.HandleRef BuildWindowCore( System.Runtime.InteropServices.HandleRef hwndParent )
+ {
+ parentWindowHandle = hwndParent.Handle;
+ _internalHwndSource = new HwndSource( new HwndSourceParameters()
+ {
+ ParentWindow = hwndParent.Handle,
+ WindowStyle = Win32Helper.WS_CHILD | Win32Helper.WS_VISIBLE | Win32Helper.WS_CLIPSIBLINGS | Win32Helper.WS_CLIPCHILDREN,
+ Width = 0,
+ Height = 0,
+ } );
+
+ _internalHost_ContentRendered = false;
+ _internalHwndSource.ContentRendered += _internalHwndSource_ContentRendered;
+ _internalHwndSource.RootVisual = _internalHostPresenter;
+ AddLogicalChild( _internalHostPresenter );
+ Win32Helper.BringWindowToTop( _internalHwndSource.Handle );
+ return new HandleRef( this, _internalHwndSource.Handle );
+ }
- private bool _internalHost_ContentRendered = false;
+ private bool _internalHost_ContentRendered = false;
- void _internalHwndSource_ContentRendered(object sender, EventArgs e)
- {
- _internalHost_ContentRendered = true;
- }
+ void _internalHwndSource_ContentRendered( object sender, EventArgs e )
+ {
+ _internalHost_ContentRendered = true;
+ }
- protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
- {
- if (msg == Win32Helper.WM_WINDOWPOSCHANGING)
- {
- if (_internalHost_ContentRendered)
- Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize);
- }
- return base.WndProc(hwnd, msg, wParam, lParam, ref handled);
- }
- protected override void DestroyWindowCore(System.Runtime.InteropServices.HandleRef hwnd)
- {
- if (_internalHwndSource != null)
- {
- _internalHwndSource.ContentRendered -= _internalHwndSource_ContentRendered;
- _internalHwndSource.Dispose();
- _internalHwndSource = null;
- }
- }
+ protected override IntPtr WndProc( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled )
+ {
+ if( msg == Win32Helper.WM_WINDOWPOSCHANGING )
+ {
+ if( _internalHost_ContentRendered )
+ Win32Helper.SetWindowPos( _internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize );
+ }
+ return base.WndProc( hwnd, msg, wParam, lParam, ref handled );
+ }
- public override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
+ protected override void DestroyWindowCore( System.Runtime.InteropServices.HandleRef hwnd )
+ {
+ if( _internalHwndSource != null )
+ {
+ _internalHwndSource.ContentRendered -= _internalHwndSource_ContentRendered;
+ _internalHwndSource.Dispose();
+ _internalHwndSource = null;
+ }
+ }
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
- }
- ContentPresenter _internalHostPresenter = new ContentPresenter();
- Grid _internalGrid = null;
- LayoutAnchorableControl _internalHost = null;
- AnchorSide _side;
- LayoutGridResizerControl _resizer = null;
- DockingManager _manager;
+ }
+
+ ContentPresenter _internalHostPresenter = new ContentPresenter();
+ Grid _internalGrid = null;
+ internal LayoutAnchorableControl _internalHost = null;
+ AnchorSide _side;
+ LayoutGridResizerControl _resizer = null;
+ DockingManager _manager;
- void _model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+ void _model_PropertyChanged( object sender, System.ComponentModel.PropertyChangedEventArgs e )
+ {
+ if( e.PropertyName == "IsAutoHidden" )
+ {
+ if( !_model.IsAutoHidden )
{
- if (e.PropertyName == "IsAutoHidden")
- {
- if (!_model.IsAutoHidden)
- {
- _manager.HideAutoHideWindow(_anchor);
- }
- }
+ _manager.HideAutoHideWindow( _anchor );
}
+ }
+ }
- void CreateInternalGrid()
- {
- _internalGrid = new Grid() { FlowDirection = System.Windows.FlowDirection.LeftToRight};
- _internalGrid.SetBinding(Grid.BackgroundProperty, new Binding("Background") { Source = this });
+ void CreateInternalGrid()
+ {
+ _internalGrid = new Grid() { FlowDirection = System.Windows.FlowDirection.LeftToRight };
+ _internalGrid.SetBinding( Grid.BackgroundProperty, new Binding( "Background" ) { Source = this } );
- _internalHost = new LayoutAnchorableControl() { Model = _model, Style = AnchorableStyle };
- _internalHost.SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this });
+ _internalHost = new LayoutAnchorableControl() { Model = _model, Style = AnchorableStyle };
+ _internalHost.SetBinding( FlowDirectionProperty, new Binding( "Model.Root.Manager.FlowDirection" ) { Source = this } );
- KeyboardNavigation.SetTabNavigation(_internalGrid, KeyboardNavigationMode.Cycle);
+ KeyboardNavigation.SetTabNavigation( _internalGrid, KeyboardNavigationMode.Cycle );
- _resizer = new LayoutGridResizerControl();
+ _resizer = new LayoutGridResizerControl();
- _resizer.DragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(OnResizerDragStarted);
- _resizer.DragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler(OnResizerDragDelta);
- _resizer.DragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(OnResizerDragCompleted);
+ _resizer.DragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler( OnResizerDragStarted );
+ _resizer.DragDelta += new System.Windows.Controls.Primitives.DragDeltaEventHandler( OnResizerDragDelta );
+ _resizer.DragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler( OnResizerDragCompleted );
- if (_side == AnchorSide.Right)
- {
- _internalGrid.ColumnDefinitions.Add(new ColumnDefinition(){ Width = new GridLength(_manager.GridSplitterWidth)});
- _internalGrid.ColumnDefinitions.Add(new ColumnDefinition(){
- Width = _model.AutoHideWidth == 0.0 ? new GridLength(_model.AutoHideMinWidth) : new GridLength(_model.AutoHideWidth, GridUnitType.Pixel)});
+ if( _side == AnchorSide.Right )
+ {
+ _internalGrid.ColumnDefinitions.Add( new ColumnDefinition() { Width = new GridLength( _manager.GridSplitterWidth ) } );
+ _internalGrid.ColumnDefinitions.Add( new ColumnDefinition()
+ {
+ Width = _model.AutoHideWidth == 0.0 ? new GridLength( _model.AutoHideMinWidth ) : new GridLength( _model.AutoHideWidth, GridUnitType.Pixel )
+ } );
- Grid.SetColumn(_resizer, 0);
- Grid.SetColumn(_internalHost, 1);
+ Grid.SetColumn( _resizer, 0 );
+ Grid.SetColumn( _internalHost, 1 );
- _resizer.Cursor = Cursors.SizeWE;
+ _resizer.Cursor = Cursors.SizeWE;
- HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
- VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
- }
- else if (_side == AnchorSide.Left)
- {
- _internalGrid.ColumnDefinitions.Add(new ColumnDefinition()
- {
- Width = _model.AutoHideWidth == 0.0 ? new GridLength(_model.AutoHideMinWidth) : new GridLength(_model.AutoHideWidth, GridUnitType.Pixel),
- });
- _internalGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(_manager.GridSplitterWidth) });
+ HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
+ VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
+ }
+ else if( _side == AnchorSide.Left )
+ {
+ _internalGrid.ColumnDefinitions.Add( new ColumnDefinition()
+ {
+ Width = _model.AutoHideWidth == 0.0 ? new GridLength( _model.AutoHideMinWidth ) : new GridLength( _model.AutoHideWidth, GridUnitType.Pixel ),
+ } );
+ _internalGrid.ColumnDefinitions.Add( new ColumnDefinition() { Width = new GridLength( _manager.GridSplitterWidth ) } );
- Grid.SetColumn(_internalHost, 0);
- Grid.SetColumn(_resizer, 1);
+ Grid.SetColumn( _internalHost, 0 );
+ Grid.SetColumn( _resizer, 1 );
- _resizer.Cursor = Cursors.SizeWE;
+ _resizer.Cursor = Cursors.SizeWE;
- HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
- VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
- }
- else if (_side == AnchorSide.Top)
- {
- _internalGrid.RowDefinitions.Add(new RowDefinition()
- {
- Height = _model.AutoHideHeight == 0.0 ? new GridLength(_model.AutoHideMinHeight) : new GridLength(_model.AutoHideHeight, GridUnitType.Pixel),
- });
- _internalGrid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(_manager.GridSplitterHeight) });
+ HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
+ VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
+ }
+ else if( _side == AnchorSide.Top )
+ {
+ _internalGrid.RowDefinitions.Add( new RowDefinition()
+ {
+ Height = _model.AutoHideHeight == 0.0 ? new GridLength( _model.AutoHideMinHeight ) : new GridLength( _model.AutoHideHeight, GridUnitType.Pixel ),
+ } );
+ _internalGrid.RowDefinitions.Add( new RowDefinition() { Height = new GridLength( _manager.GridSplitterHeight ) } );
- Grid.SetRow(_internalHost, 0);
- Grid.SetRow(_resizer, 1);
+ Grid.SetRow( _internalHost, 0 );
+ Grid.SetRow( _resizer, 1 );
- _resizer.Cursor = Cursors.SizeNS;
+ _resizer.Cursor = Cursors.SizeNS;
- VerticalAlignment = System.Windows.VerticalAlignment.Top;
- HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
+ VerticalAlignment = System.Windows.VerticalAlignment.Top;
+ HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
- }
- else if (_side == AnchorSide.Bottom)
- {
- _internalGrid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(_manager.GridSplitterHeight) });
- _internalGrid.RowDefinitions.Add(new RowDefinition()
- {
- Height = _model.AutoHideHeight == 0.0 ? new GridLength(_model.AutoHideMinHeight) : new GridLength(_model.AutoHideHeight, GridUnitType.Pixel),
- });
+ }
+ else if( _side == AnchorSide.Bottom )
+ {
+ _internalGrid.RowDefinitions.Add( new RowDefinition() { Height = new GridLength( _manager.GridSplitterHeight ) } );
+ _internalGrid.RowDefinitions.Add( new RowDefinition()
+ {
+ Height = _model.AutoHideHeight == 0.0 ? new GridLength( _model.AutoHideMinHeight ) : new GridLength( _model.AutoHideHeight, GridUnitType.Pixel ),
+ } );
- Grid.SetRow(_resizer, 0);
- Grid.SetRow(_internalHost, 1);
+ Grid.SetRow( _resizer, 0 );
+ Grid.SetRow( _internalHost, 1 );
- _resizer.Cursor = Cursors.SizeNS;
+ _resizer.Cursor = Cursors.SizeNS;
- VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
- HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
- }
+ VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
+ HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
+ }
- _internalGrid.Children.Add(_resizer);
- _internalGrid.Children.Add(_internalHost);
- _internalHostPresenter.Content = _internalGrid;
- }
+ _internalGrid.Children.Add( _resizer );
+ _internalGrid.Children.Add( _internalHost );
+ _internalHostPresenter.Content = _internalGrid;
+ }
- void RemoveInternalGrid()
- {
- _resizer.DragStarted -= new System.Windows.Controls.Primitives.DragStartedEventHandler(OnResizerDragStarted);
- _resizer.DragDelta -= new System.Windows.Controls.Primitives.DragDeltaEventHandler(OnResizerDragDelta);
- _resizer.DragCompleted -= new System.Windows.Controls.Primitives.DragCompletedEventHandler(OnResizerDragCompleted);
+ void RemoveInternalGrid()
+ {
+ _resizer.DragStarted -= new System.Windows.Controls.Primitives.DragStartedEventHandler( OnResizerDragStarted );
+ _resizer.DragDelta -= new System.Windows.Controls.Primitives.DragDeltaEventHandler( OnResizerDragDelta );
+ _resizer.DragCompleted -= new System.Windows.Controls.Primitives.DragCompletedEventHandler( OnResizerDragCompleted );
- _internalHostPresenter.Content = null;
- }
+ _internalHostPresenter.Content = null;
+ }
- protected override bool HasFocusWithinCore()
- {
- return false;
- }
+ protected override bool HasFocusWithinCore()
+ {
+ return false;
+ }
- #region Resizer
+ #region Resizer
- Border _resizerGhost = null;
- Window _resizerWindowHost = null;
- Vector _initialStartPoint;
+ Border _resizerGhost = null;
+ Window _resizerWindowHost = null;
+ Vector _initialStartPoint;
- void ShowResizerOverlayWindow(LayoutGridResizerControl splitter)
- {
- _resizerGhost = new Border()
- {
- Background = splitter.BackgroundWhileDragging,
- Opacity = splitter.OpacityWhileDragging
- };
-
- var areaElement = _manager.GetAutoHideAreaElement();
- var modelControlActualSize = this._internalHost.TransformActualSizeToAncestor();
-
- Point ptTopLeftScreen = areaElement.PointToScreenDPIWithoutFlowDirection(new Point());
-
- var managerSize = areaElement.TransformActualSizeToAncestor();
-
- Size windowSize;
-
- if (_side == AnchorSide.Right || _side == AnchorSide.Left)
- {
- windowSize = new Size(
- managerSize.Width - 25.0 + splitter.ActualWidth,
- managerSize.Height);
-
- _resizerGhost.Width = splitter.ActualWidth;
- _resizerGhost.Height = windowSize.Height;
- ptTopLeftScreen.Offset(25, 0.0);
- }
- else
- {
- windowSize = new Size(
- managerSize.Width,
- managerSize.Height - _model.AutoHideMinHeight - 25.0 + splitter.ActualHeight);
-
- _resizerGhost.Height = splitter.ActualHeight;
- _resizerGhost.Width = windowSize.Width;
- ptTopLeftScreen.Offset(0.0, 25.0);
- }
-
- _initialStartPoint = splitter.PointToScreenDPIWithoutFlowDirection(new Point()) - ptTopLeftScreen;
-
- if (_side == AnchorSide.Right || _side == AnchorSide.Left)
- {
- Canvas.SetLeft(_resizerGhost, _initialStartPoint.X);
- }
- else
- {
- Canvas.SetTop(_resizerGhost, _initialStartPoint.Y);
- }
-
- Canvas panelHostResizer = new Canvas()
- {
- HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
- VerticalAlignment = System.Windows.VerticalAlignment.Stretch
- };
-
- panelHostResizer.Children.Add(_resizerGhost);
-
-
- _resizerWindowHost = new Window()
- {
- ResizeMode = ResizeMode.NoResize,
- WindowStyle = System.Windows.WindowStyle.None,
- ShowInTaskbar = false,
- AllowsTransparency = true,
- Background = null,
- Width = windowSize.Width,
- Height = windowSize.Height,
- Left = ptTopLeftScreen.X,
- Top = ptTopLeftScreen.Y,
- ShowActivated = false,
- Owner = Window.GetWindow(this),
- Content = panelHostResizer
- };
-
- _resizerWindowHost.Show();
- }
+ void ShowResizerOverlayWindow( LayoutGridResizerControl splitter )
+ {
+ _resizerGhost = new Border()
+ {
+ Background = splitter.BackgroundWhileDragging,
+ Opacity = splitter.OpacityWhileDragging
+ };
+
+ var areaElement = _manager.GetAutoHideAreaElement();
+ var modelControlActualSize = this._internalHost.TransformActualSizeToAncestor();
+
+ Point ptTopLeftScreen = areaElement.PointToScreenDPIWithoutFlowDirection( new Point() );
+
+ var managerSize = areaElement.TransformActualSizeToAncestor();
+
+ Size windowSize;
+
+ if( _side == AnchorSide.Right || _side == AnchorSide.Left )
+ {
+ windowSize = new Size(
+ managerSize.Width - 25.0 + splitter.ActualWidth,
+ managerSize.Height );
+
+ _resizerGhost.Width = splitter.ActualWidth;
+ _resizerGhost.Height = windowSize.Height;
+ ptTopLeftScreen.Offset( 25, 0.0 );
+ }
+ else
+ {
+ windowSize = new Size(
+ managerSize.Width,
+ managerSize.Height - _model.AutoHideMinHeight - 25.0 + splitter.ActualHeight );
+
+ _resizerGhost.Height = splitter.ActualHeight;
+ _resizerGhost.Width = windowSize.Width;
+ ptTopLeftScreen.Offset( 0.0, 25.0 );
+ }
+
+ _initialStartPoint = splitter.PointToScreenDPIWithoutFlowDirection( new Point() ) - ptTopLeftScreen;
+
+ if( _side == AnchorSide.Right || _side == AnchorSide.Left )
+ {
+ Canvas.SetLeft( _resizerGhost, _initialStartPoint.X );
+ }
+ else
+ {
+ Canvas.SetTop( _resizerGhost, _initialStartPoint.Y );
+ }
+
+ Canvas panelHostResizer = new Canvas()
+ {
+ HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
+ VerticalAlignment = System.Windows.VerticalAlignment.Stretch
+ };
+
+ panelHostResizer.Children.Add( _resizerGhost );
+
+
+ _resizerWindowHost = new Window()
+ {
+ ResizeMode = ResizeMode.NoResize,
+ WindowStyle = System.Windows.WindowStyle.None,
+ ShowInTaskbar = false,
+ AllowsTransparency = true,
+ Background = null,
+ Width = windowSize.Width,
+ Height = windowSize.Height,
+ Left = ptTopLeftScreen.X,
+ Top = ptTopLeftScreen.Y,
+ ShowActivated = false,
+ Owner = Window.GetWindow( this ),
+ Content = panelHostResizer
+ };
+
+ _resizerWindowHost.Show();
+ }
- void HideResizerOverlayWindow()
- {
- if (_resizerWindowHost != null)
- {
- _resizerWindowHost.Close();
- _resizerWindowHost = null;
- }
- }
+ void HideResizerOverlayWindow()
+ {
+ if( _resizerWindowHost != null )
+ {
+ _resizerWindowHost.Close();
+ _resizerWindowHost = null;
+ }
+ }
- internal bool IsResizing
- {
- get;
- private set;
- }
+ internal bool IsResizing
+ {
+ get;
+ private set;
+ }
- void OnResizerDragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
- {
- LayoutGridResizerControl splitter = sender as LayoutGridResizerControl;
- var rootVisual = this.FindVisualTreeRoot() as Visual;
-
- var trToWnd = TransformToAncestor(rootVisual);
- Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
- trToWnd.Transform(new Point());
-
- double delta;
- if (_side == AnchorSide.Right || _side == AnchorSide.Left)
- delta = Canvas.GetLeft(_resizerGhost) - _initialStartPoint.X;
- else
- delta = Canvas.GetTop(_resizerGhost) - _initialStartPoint.Y;
-
- if (_side == AnchorSide.Right)
- {
- if (_model.AutoHideWidth == 0.0)
- _model.AutoHideWidth = _internalHost.ActualWidth - delta;
- else
- _model.AutoHideWidth -= delta;
-
- _internalGrid.ColumnDefinitions[1].Width = new GridLength(_model.AutoHideWidth, GridUnitType.Pixel);
- }
- else if (_side == AnchorSide.Left)
- {
- if (_model.AutoHideWidth == 0.0)
- _model.AutoHideWidth = _internalHost.ActualWidth + delta;
- else
- _model.AutoHideWidth += delta;
-
- _internalGrid.ColumnDefinitions[0].Width = new GridLength(_model.AutoHideWidth, GridUnitType.Pixel);
- }
- else if (_side == AnchorSide.Top)
- {
- if (_model.AutoHideHeight == 0.0)
- _model.AutoHideHeight = _internalHost.ActualHeight + delta;
- else
- _model.AutoHideHeight += delta;
-
- _internalGrid.RowDefinitions[0].Height = new GridLength(_model.AutoHideHeight, GridUnitType.Pixel);
- }
- else if (_side == AnchorSide.Bottom)
- {
- if (_model.AutoHideHeight == 0.0)
- _model.AutoHideHeight = _internalHost.ActualHeight - delta;
- else
- _model.AutoHideHeight -= delta;
-
- _internalGrid.RowDefinitions[1].Height = new GridLength(_model.AutoHideHeight, GridUnitType.Pixel);
- }
-
- HideResizerOverlayWindow();
-
- IsResizing = false;
- InvalidateMeasure();
- }
+ void OnResizerDragCompleted( object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e )
+ {
+ LayoutGridResizerControl splitter = sender as LayoutGridResizerControl;
+ var rootVisual = this.FindVisualTreeRoot() as Visual;
+
+ var trToWnd = TransformToAncestor( rootVisual );
+ Vector transformedDelta = trToWnd.Transform( new Point( e.HorizontalChange, e.VerticalChange ) ) -
+ trToWnd.Transform( new Point() );
+
+ double delta;
+ if( _side == AnchorSide.Right || _side == AnchorSide.Left )
+ delta = Canvas.GetLeft( _resizerGhost ) - _initialStartPoint.X;
+ else
+ delta = Canvas.GetTop( _resizerGhost ) - _initialStartPoint.Y;
+
+ if( _side == AnchorSide.Right )
+ {
+ if( _model.AutoHideWidth == 0.0 )
+ _model.AutoHideWidth = _internalHost.ActualWidth - delta;
+ else
+ _model.AutoHideWidth -= delta;
+
+ _internalGrid.ColumnDefinitions[ 1 ].Width = new GridLength( _model.AutoHideWidth, GridUnitType.Pixel );
+ }
+ else if( _side == AnchorSide.Left )
+ {
+ if( _model.AutoHideWidth == 0.0 )
+ _model.AutoHideWidth = _internalHost.ActualWidth + delta;
+ else
+ _model.AutoHideWidth += delta;
+
+ _internalGrid.ColumnDefinitions[ 0 ].Width = new GridLength( _model.AutoHideWidth, GridUnitType.Pixel );
+ }
+ else if( _side == AnchorSide.Top )
+ {
+ if( _model.AutoHideHeight == 0.0 )
+ _model.AutoHideHeight = _internalHost.ActualHeight + delta;
+ else
+ _model.AutoHideHeight += delta;
+
+ _internalGrid.RowDefinitions[ 0 ].Height = new GridLength( _model.AutoHideHeight, GridUnitType.Pixel );
+ }
+ else if( _side == AnchorSide.Bottom )
+ {
+ if( _model.AutoHideHeight == 0.0 )
+ _model.AutoHideHeight = _internalHost.ActualHeight - delta;
+ else
+ _model.AutoHideHeight -= delta;
+
+ _internalGrid.RowDefinitions[ 1 ].Height = new GridLength( _model.AutoHideHeight, GridUnitType.Pixel );
+ }
+
+ HideResizerOverlayWindow();
+
+ IsResizing = false;
+ InvalidateMeasure();
+ }
- void OnResizerDragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e)
- {
- LayoutGridResizerControl splitter = sender as LayoutGridResizerControl;
- var rootVisual = this.FindVisualTreeRoot() as Visual;
-
- var trToWnd = TransformToAncestor(rootVisual);
- Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
- trToWnd.Transform(new Point());
-
- if (_side == AnchorSide.Right || _side == AnchorSide.Left)
- {
- if (FrameworkElement.GetFlowDirection(_internalHost) == System.Windows.FlowDirection.RightToLeft)
- transformedDelta.X = -transformedDelta.X;
- Canvas.SetLeft(_resizerGhost, MathHelper.MinMax(_initialStartPoint.X + transformedDelta.X, 0.0, _resizerWindowHost.Width - _resizerGhost.Width));
- }
- else
- {
- Canvas.SetTop(_resizerGhost, MathHelper.MinMax(_initialStartPoint.Y + transformedDelta.Y, 0.0, _resizerWindowHost.Height - _resizerGhost.Height));
- }
- }
+ void OnResizerDragDelta( object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e )
+ {
+ LayoutGridResizerControl splitter = sender as LayoutGridResizerControl;
+ var rootVisual = this.FindVisualTreeRoot() as Visual;
+
+ var trToWnd = TransformToAncestor( rootVisual );
+ Vector transformedDelta = trToWnd.Transform( new Point( e.HorizontalChange, e.VerticalChange ) ) -
+ trToWnd.Transform( new Point() );
+
+ if( _side == AnchorSide.Right || _side == AnchorSide.Left )
+ {
+ if( FrameworkElement.GetFlowDirection( _internalHost ) == System.Windows.FlowDirection.RightToLeft )
+ transformedDelta.X = -transformedDelta.X;
+ Canvas.SetLeft( _resizerGhost, MathHelper.MinMax( _initialStartPoint.X + transformedDelta.X, 0.0, _resizerWindowHost.Width - _resizerGhost.Width ) );
+ }
+ else
+ {
+ Canvas.SetTop( _resizerGhost, MathHelper.MinMax( _initialStartPoint.Y + transformedDelta.Y, 0.0, _resizerWindowHost.Height - _resizerGhost.Height ) );
+ }
+ }
- void OnResizerDragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
- {
- var resizer = sender as LayoutGridResizerControl;
- ShowResizerOverlayWindow(resizer);
- IsResizing = true;
- }
- #endregion
+ void OnResizerDragStarted( object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e )
+ {
+ var resizer = sender as LayoutGridResizerControl;
+ ShowResizerOverlayWindow( resizer );
+ IsResizing = true;
+ }
+ #endregion
- protected override System.Collections.IEnumerator LogicalChildren
- {
- get
- {
- if (_internalHostPresenter == null)
- return new UIElement[] { }.GetEnumerator();
- return new UIElement[] { _internalHostPresenter }.GetEnumerator();
- }
- }
+ protected override System.Collections.IEnumerator LogicalChildren
+ {
+ get
+ {
+ if( _internalHostPresenter == null )
+ return new UIElement[] { }.GetEnumerator();
+ return new UIElement[] { _internalHostPresenter }.GetEnumerator();
+ }
+ }
- protected override Size MeasureOverride(Size constraint)
- {
- if (_internalHostPresenter == null)
- return base.MeasureOverride(constraint);
+ protected override Size MeasureOverride( Size constraint )
+ {
+ if( _internalHostPresenter == null )
+ return base.MeasureOverride( constraint );
- _internalHostPresenter.Measure(constraint);
- //return base.MeasureOverride(constraint);
- return _internalHostPresenter.DesiredSize;
- }
+ _internalHostPresenter.Measure( constraint );
+ //return base.MeasureOverride(constraint);
+ return _internalHostPresenter.DesiredSize;
+ }
- protected override Size ArrangeOverride(Size finalSize)
- {
- if (_internalHostPresenter == null)
- return base.ArrangeOverride(finalSize);
+ protected override Size ArrangeOverride( Size finalSize )
+ {
+ if( _internalHostPresenter == null )
+ return base.ArrangeOverride( finalSize );
- _internalHostPresenter.Arrange(new Rect(finalSize));
- return base.ArrangeOverride(finalSize);// new Size(_internalHostPresenter.ActualWidth, _internalHostPresenter.ActualHeight);
- }
+ _internalHostPresenter.Arrange( new Rect( finalSize ) );
+ return base.ArrangeOverride( finalSize );// new Size(_internalHostPresenter.ActualWidth, _internalHostPresenter.ActualHeight);
+ }
- #region Background
+ #region Background
- ///
- /// Background Dependency Property
- ///
- public static readonly DependencyProperty BackgroundProperty =
- DependencyProperty.Register("Background", typeof(Brush), typeof(LayoutAutoHideWindowControl),
- new FrameworkPropertyMetadata((Brush)null));
+ ///
+ /// Background Dependency Property
+ ///
+ public static readonly DependencyProperty BackgroundProperty =
+ DependencyProperty.Register( "Background", typeof( Brush ), typeof( LayoutAutoHideWindowControl ),
+ new FrameworkPropertyMetadata( ( Brush )null ) );
- ///
- /// Gets or sets the Background property. This dependency property
- /// indicates background of the autohide childwindow.
- ///
- public Brush Background
- {
- get { return (Brush)GetValue(BackgroundProperty); }
- set { SetValue(BackgroundProperty, value); }
- }
+ ///
+ /// Gets or sets the Background property. This dependency property
+ /// indicates background of the autohide childwindow.
+ ///
+ public Brush Background
+ {
+ get
+ {
+ return ( Brush )GetValue( BackgroundProperty );
+ }
+ set
+ {
+ SetValue( BackgroundProperty, value );
+ }
+ }
- #endregion
+ #endregion
- internal bool IsWin32MouseOver
- {
- get
- {
- var ptMouse = new Win32Helper.Win32Point();
- if (!Win32Helper.GetCursorPos(ref ptMouse))
- return false;
+ internal bool IsWin32MouseOver
+ {
+ get
+ {
+ var ptMouse = new Win32Helper.Win32Point();
+ if( !Win32Helper.GetCursorPos( ref ptMouse ) )
+ return false;
- Point location = this.PointToScreenDPI(new Point());
+ Point location = this.PointToScreenDPI( new Point() );
- Rect rectWindow = this.GetScreenArea();
- if (rectWindow.Contains(new Point(ptMouse.X, ptMouse.Y)))
- return true;
+ Rect rectWindow = this.GetScreenArea();
+ if( rectWindow.Contains( new Point( ptMouse.X, ptMouse.Y ) ) )
+ return true;
- var manager = Model.Root.Manager;
- var anchor = manager.FindVisualChildren().Where(c => c.Model == Model).FirstOrDefault();
+ var manager = Model.Root.Manager;
+ var anchor = manager.FindVisualChildren().Where( c => c.Model == Model ).FirstOrDefault();
- if (anchor == null)
- return false;
+ if( anchor == null )
+ return false;
- location = anchor.PointToScreenDPI(new Point());
+ location = anchor.PointToScreenDPI( new Point() );
- if (anchor.IsMouseOver)
- return true;
+ if( anchor.IsMouseOver )
+ return true;
- return false;
- }
- }
+ return false;
+ }
+ }
- #region AnchorableStyle
+ #region AnchorableStyle
- ///
- /// AnchorableStyle Dependency Property
- ///
- public static readonly DependencyProperty AnchorableStyleProperty =
- DependencyProperty.Register("AnchorableStyle", typeof(Style), typeof(LayoutAutoHideWindowControl),
- new FrameworkPropertyMetadata((Style)null));
+ ///
+ /// AnchorableStyle Dependency Property
+ ///
+ public static readonly DependencyProperty AnchorableStyleProperty =
+ DependencyProperty.Register( "AnchorableStyle", typeof( Style ), typeof( LayoutAutoHideWindowControl ),
+ new FrameworkPropertyMetadata( ( Style )null ) );
- ///
- /// Gets or sets the AnchorableStyle property. This dependency property
- /// indicates the style to apply to the LayoutAnchorableControl hosted in this auto hide window.
- ///
- public Style AnchorableStyle
- {
- get { return (Style)GetValue(AnchorableStyleProperty); }
- set { SetValue(AnchorableStyleProperty, value); }
- }
+ ///
+ /// Gets or sets the AnchorableStyle property. This dependency property
+ /// indicates the style to apply to the LayoutAnchorableControl hosted in this auto hide window.
+ ///
+ public Style AnchorableStyle
+ {
+ get
+ {
+ return ( Style )GetValue( AnchorableStyleProperty );
+ }
+ set
+ {
+ SetValue( AnchorableStyleProperty, value );
+ }
+ }
- #endregion
+ #endregion
- }
+ }
}
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs
index 9e2f8449..5ecc3963 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs
@@ -160,6 +160,7 @@ protected override void OnMouseRightButtonDown( MouseButtonEventArgs e )
base.OnMouseLeftButtonDown( e );
}
+
private void SetIsActive()
{
if( this.Model != null )
diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneControl.cs
index 8e84124d..1e173520 100644
--- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneControl.cs
+++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentPaneControl.cs
@@ -16,83 +16,84 @@ This program is provided to you under the terms of the Microsoft Public
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Windows;
-using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Windows.Data;
using Xceed.Wpf.AvalonDock.Layout;
namespace Xceed.Wpf.AvalonDock.Controls
{
- public class LayoutDocumentPaneControl : TabControl, ILayoutControl//, ILogicalChildrenContainer
+ public class LayoutDocumentPaneControl : TabControl, ILayoutControl//, ILogicalChildrenContainer
+ {
+ static LayoutDocumentPaneControl()
{
- static LayoutDocumentPaneControl()
- {
- FocusableProperty.OverrideMetadata(typeof(LayoutDocumentPaneControl), new FrameworkPropertyMetadata(false));
- }
+ FocusableProperty.OverrideMetadata( typeof( LayoutDocumentPaneControl ), new FrameworkPropertyMetadata( false ) );
+ }
- internal LayoutDocumentPaneControl(LayoutDocumentPane model)
- {
- if (model == null)
- throw new ArgumentNullException("model");
+ internal LayoutDocumentPaneControl( LayoutDocumentPane model )
+ {
+ if( model == null )
+ throw new ArgumentNullException( "model" );
- _model = model;
- SetBinding(ItemsSourceProperty, new Binding("Model.Children") { Source = this });
- SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this });
+ _model = model;
+ SetBinding( ItemsSourceProperty, new Binding( "Model.Children" ) { Source = this } );
+ SetBinding( FlowDirectionProperty, new Binding( "Model.Root.Manager.FlowDirection" ) { Source = this } );
- this.LayoutUpdated += new EventHandler(OnLayoutUpdated);
- }
+ this.LayoutUpdated += new EventHandler( OnLayoutUpdated );
+ }
- void OnLayoutUpdated(object sender, EventArgs e)
- {
- var modelWithAtcualSize = _model as ILayoutPositionableElementWithActualSize;
- modelWithAtcualSize.ActualWidth = ActualWidth;
- modelWithAtcualSize.ActualHeight = ActualHeight;
- }
+ void OnLayoutUpdated( object sender, EventArgs e )
+ {
+ var modelWithAtcualSize = _model as ILayoutPositionableElementWithActualSize;
+ modelWithAtcualSize.ActualWidth = ActualWidth;
+ modelWithAtcualSize.ActualHeight = ActualHeight;
+ }
- protected override void OnSelectionChanged(SelectionChangedEventArgs e)
- {
- base.OnSelectionChanged(e);
+ protected override void OnSelectionChanged( SelectionChangedEventArgs e )
+ {
+ base.OnSelectionChanged( e );
- if (_model.SelectedContent != null)
- _model.SelectedContent.IsActive = true;
- }
+ if( _model.SelectedContent != null )
+ _model.SelectedContent.IsActive = true;
+ }
- List