Browse Source

Formatted all of AvalonDock project after adding editor config.

pull/1645/head
Johannes Brittain 8 years ago
parent
commit
bae64f36ad
  1. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/AnchorablePaneTitle.cs
  2. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DocumentPaneControlOverlayArea.cs
  3. 370
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DragService.cs
  4. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropDownButton.cs
  5. 156
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs
  6. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs
  7. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs
  8. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableItem.cs
  9. 36
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs
  10. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs
  11. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentItem.cs
  12. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs
  13. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs
  14. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs
  15. 70
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs
  16. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/NavigatorWindow.cs
  17. 114
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/OverlayWindow.cs
  18. 72
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs
  19. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/Extentions.cs
  20. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs
  21. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorableFloatingWindow.cs
  22. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorablePane.cs
  23. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorablePaneGroup.cs
  24. 82
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs
  25. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocument.cs
  26. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentFloatingWindow.cs
  27. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentPane.cs
  28. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentPaneGroup.cs
  29. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutElement.cs
  30. 14
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPanel.cs
  31. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutRoot.cs
  32. 10
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Properties/AssemblyInfo.cs

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/AnchorablePaneTitle.cs

@ -52,7 +52,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// Model Dependency Property /// Model Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutAnchorable ), typeof( AnchorablePaneTitle ), public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutAnchorable ), typeof( AnchorablePaneTitle ),
new FrameworkPropertyMetadata( ( LayoutAnchorable )null, new PropertyChangedCallback( _OnModelChanged ) ) ); new FrameworkPropertyMetadata( ( LayoutAnchorable )null, new PropertyChangedCallback( _OnModelChanged ) ) );
/// <summary> /// <summary>
@ -98,10 +98,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// LayoutItem Read-Only Dependency Property /// LayoutItem Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey LayoutItemPropertyKey = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( AnchorablePaneTitle ), private static readonly DependencyPropertyKey LayoutItemPropertyKey = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( AnchorablePaneTitle ),
new FrameworkPropertyMetadata( ( LayoutItem )null ) ); new FrameworkPropertyMetadata( ( LayoutItem )null ) );
public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty; public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty;
/// <summary> /// <summary>
/// Gets the LayoutItem property. This dependency property /// Gets the LayoutItem property. This dependency property

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DocumentPaneControlOverlayArea.cs

@ -34,7 +34,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
: base( overlayWindow ) : base( overlayWindow )
{ {
_documentPaneControl = documentPaneControl; _documentPaneControl = documentPaneControl;
base.SetScreenDetectionArea( new Rect( _documentPaneControl.PointToScreenDPI( new Point() ), _documentPaneControl.TransformActualSizeToAncestor() ) ); base.SetScreenDetectionArea( new Rect( _documentPaneControl.PointToScreenDPI( new Point() ), _documentPaneControl.TransformActualSizeToAncestor() ) );
} }
#endregion #endregion

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

@ -21,193 +21,193 @@ using Xceed.Wpf.AvalonDock.Layout;
namespace Xceed.Wpf.AvalonDock.Controls namespace Xceed.Wpf.AvalonDock.Controls
{ {
internal class DragService internal class DragService
{ {
#region Members #region Members
private DockingManager _manager; private DockingManager _manager;
private LayoutFloatingWindowControl _floatingWindow; private LayoutFloatingWindowControl _floatingWindow;
private List<IOverlayWindowHost> _overlayWindowHosts = new List<IOverlayWindowHost>(); private List<IOverlayWindowHost> _overlayWindowHosts = new List<IOverlayWindowHost>();
private IOverlayWindowHost _currentHost; private IOverlayWindowHost _currentHost;
private IOverlayWindow _currentWindow; private IOverlayWindow _currentWindow;
private List<IDropArea> _currentWindowAreas = new List<IDropArea>(); private List<IDropArea> _currentWindowAreas = new List<IDropArea>();
private IDropTarget _currentDropTarget; private IDropTarget _currentDropTarget;
#endregion #endregion
#region Public Methods #region Public Methods
public DragService(LayoutFloatingWindowControl floatingWindow) public DragService( LayoutFloatingWindowControl floatingWindow )
{ {
_floatingWindow = floatingWindow; _floatingWindow = floatingWindow;
_manager = floatingWindow.Model.Root.Manager; _manager = floatingWindow.Model.Root.Manager;
GetOverlayWindowHosts(); GetOverlayWindowHosts();
} }
public void UpdateMouseLocation(Point dragPosition) public void UpdateMouseLocation( Point dragPosition )
{ {
if (!_floatingWindow.Model.Root.ActiveContent.CanDock) return; if( !_floatingWindow.Model.Root.ActiveContent.CanDock ) return;
var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow; var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
var newHost = _overlayWindowHosts.FirstOrDefault(oh => oh.HitTest(dragPosition)); var newHost = _overlayWindowHosts.FirstOrDefault( oh => oh.HitTest( dragPosition ) );
if (_currentHost != null || _currentHost != newHost) if( _currentHost != null || _currentHost != newHost )
{ {
//is mouse still inside current overlay window host? //is mouse still inside current overlay window host?
if ((_currentHost != null && !_currentHost.HitTest(dragPosition)) || if( ( _currentHost != null && !_currentHost.HitTest( dragPosition ) ) ||
_currentHost != newHost) _currentHost != newHost )
{ {
//esit drop target //esit drop target
if (_currentDropTarget != null) if( _currentDropTarget != null )
_currentWindow.DragLeave(_currentDropTarget); _currentWindow.DragLeave( _currentDropTarget );
_currentDropTarget = null; _currentDropTarget = null;
//exit area //exit area
_currentWindowAreas.ForEach(a => _currentWindowAreas.ForEach( a =>
_currentWindow.DragLeave(a)); _currentWindow.DragLeave( a ) );
_currentWindowAreas.Clear(); _currentWindowAreas.Clear();
//hide current overlay window //hide current overlay window
if (_currentWindow != null) if( _currentWindow != null )
_currentWindow.DragLeave(_floatingWindow); _currentWindow.DragLeave( _floatingWindow );
if (_currentHost != null) if( _currentHost != null )
_currentHost.HideOverlayWindow(); _currentHost.HideOverlayWindow();
_currentHost = null; _currentHost = null;
} }
if (_currentHost != newHost) if( _currentHost != newHost )
{ {
_currentHost = newHost; _currentHost = newHost;
_currentWindow = _currentHost.ShowOverlayWindow(_floatingWindow); _currentWindow = _currentHost.ShowOverlayWindow( _floatingWindow );
_currentWindow.DragEnter(_floatingWindow); _currentWindow.DragEnter( _floatingWindow );
} }
} }
else if (_currentHost == null) else if( _currentHost == null )
{ {
// there are no dock areas // there are no dock areas
if (_manager.Parent is DockingManager) if( _manager.Parent is DockingManager )
{ {
_manager = _manager.Parent as DockingManager; _manager = _manager.Parent as DockingManager;
GetOverlayWindowHosts(); GetOverlayWindowHosts();
UpdateMouseLocation(dragPosition); UpdateMouseLocation( dragPosition );
} }
return; return;
} }
if (_currentDropTarget != null && if( _currentDropTarget != null &&
!_currentDropTarget.HitTest(dragPosition)) !_currentDropTarget.HitTest( dragPosition ) )
{ {
_currentWindow.DragLeave(_currentDropTarget); _currentWindow.DragLeave( _currentDropTarget );
_currentDropTarget = null; _currentDropTarget = null;
} }
List<IDropArea> areasToRemove = new List<IDropArea>(); List<IDropArea> areasToRemove = new List<IDropArea>();
_currentWindowAreas.ForEach(a => _currentWindowAreas.ForEach( a =>
{ {
//is mouse still inside this area? //is mouse still inside this area?
if (!a.DetectionRect.Contains(dragPosition)) if( !a.DetectionRect.Contains( dragPosition ) )
{ {
_currentWindow.DragLeave(a); _currentWindow.DragLeave( a );
areasToRemove.Add(a); areasToRemove.Add( a );
} }
}); } );
areasToRemove.ForEach(a => areasToRemove.ForEach( a =>
_currentWindowAreas.Remove(a)); _currentWindowAreas.Remove( a ) );
var areasToAdd = var areasToAdd =
_currentHost.GetDropAreas(_floatingWindow).Where(cw => !_currentWindowAreas.Contains(cw) && cw.DetectionRect.Contains(dragPosition)).ToList(); _currentHost.GetDropAreas( _floatingWindow ).Where( cw => !_currentWindowAreas.Contains( cw ) && cw.DetectionRect.Contains( dragPosition ) ).ToList();
_currentWindowAreas.AddRange(areasToAdd); _currentWindowAreas.AddRange( areasToAdd );
areasToAdd.ForEach(a => areasToAdd.ForEach( a =>
_currentWindow.DragEnter(a)); _currentWindow.DragEnter( a ) );
if (_currentDropTarget == null) if( _currentDropTarget == null )
{ {
_currentWindowAreas.ForEach(wa => _currentWindowAreas.ForEach( wa =>
{ {
if (_currentDropTarget != null) if( _currentDropTarget != null )
return; return;
_currentDropTarget = _currentWindow.GetTargets().FirstOrDefault(dt => dt.HitTest(dragPosition)); _currentDropTarget = _currentWindow.GetTargets().FirstOrDefault( dt => dt.HitTest( dragPosition ) );
if (_currentDropTarget != null) if( _currentDropTarget != null )
{ {
_currentWindow.DragEnter(_currentDropTarget); _currentWindow.DragEnter( _currentDropTarget );
return; return;
} }
}); } );
} }
} }
public void Drop(Point dropLocation, out bool dropHandled) public void Drop( Point dropLocation, out bool dropHandled )
{ {
dropHandled = false; dropHandled = false;
UpdateMouseLocation(dropLocation); UpdateMouseLocation( dropLocation );
var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow; var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
var root = floatingWindowModel.Root; var root = floatingWindowModel.Root;
if (_currentHost != null) if( _currentHost != null )
_currentHost.HideOverlayWindow(); _currentHost.HideOverlayWindow();
if (_currentDropTarget != null) if( _currentDropTarget != null )
{ {
_currentWindow.DragDrop(_currentDropTarget); _currentWindow.DragDrop( _currentDropTarget );
root.CollectGarbage(); root.CollectGarbage();
dropHandled = true; dropHandled = true;
} }
_currentWindowAreas.ForEach(a => _currentWindow.DragLeave(a)); _currentWindowAreas.ForEach( a => _currentWindow.DragLeave( a ) );
if (_currentDropTarget != null) if( _currentDropTarget != null )
_currentWindow.DragLeave(_currentDropTarget); _currentWindow.DragLeave( _currentDropTarget );
if (_currentWindow != null) if( _currentWindow != null )
_currentWindow.DragLeave(_floatingWindow); _currentWindow.DragLeave( _floatingWindow );
_currentWindow = null; _currentWindow = null;
_currentHost = null; _currentHost = null;
} }
#endregion #endregion
#region Internal Methods #region Internal Methods
internal void Abort() internal void Abort()
{ {
var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow; var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
if (_currentWindow != null) if( _currentWindow != null )
_currentWindowAreas.ForEach(a => _currentWindow.DragLeave(a)); _currentWindowAreas.ForEach( a => _currentWindow.DragLeave( a ) );
if (_currentDropTarget != null) if( _currentDropTarget != null )
_currentWindow.DragLeave(_currentDropTarget); _currentWindow.DragLeave( _currentDropTarget );
if (_currentWindow != null) if( _currentWindow != null )
_currentWindow.DragLeave(_floatingWindow); _currentWindow.DragLeave( _floatingWindow );
_currentWindow = null; _currentWindow = null;
if (_currentHost != null) if( _currentHost != null )
_currentHost.HideOverlayWindow(); _currentHost.HideOverlayWindow();
_currentHost = null; _currentHost = null;
} }
#endregion #endregion
#region Private Methods #region Private Methods
private void GetOverlayWindowHosts() private void GetOverlayWindowHosts()
{ {
_overlayWindowHosts.AddRange(_manager.GetFloatingWindowsByZOrder().OfType<LayoutAnchorableFloatingWindowControl>().Where(fw => fw != _floatingWindow && fw.IsVisible)); _overlayWindowHosts.AddRange( _manager.GetFloatingWindowsByZOrder().OfType<LayoutAnchorableFloatingWindowControl>().Where( fw => fw != _floatingWindow && fw.IsVisible ) );
_overlayWindowHosts.Add(_manager); _overlayWindowHosts.Add( _manager );
} }
#endregion #endregion
} }
} }

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropDownButton.cs

@ -38,8 +38,8 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// DropDownContextMenu Dependency Property /// DropDownContextMenu Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty DropDownContextMenuProperty = DependencyProperty.Register( "DropDownContextMenu", typeof( ContextMenu ), typeof( DropDownButton ), public static readonly DependencyProperty DropDownContextMenuProperty = DependencyProperty.Register( "DropDownContextMenu", typeof( ContextMenu ), typeof( DropDownButton ),
new FrameworkPropertyMetadata( ( ContextMenu )null, new PropertyChangedCallback( OnDropDownContextMenuChanged ) ) ); new FrameworkPropertyMetadata( ( ContextMenu )null, new PropertyChangedCallback( OnDropDownContextMenuChanged ) ) );
/// <summary> /// <summary>
/// Gets or sets the DropDownContextMenu property. This dependency property /// Gets or sets the DropDownContextMenu property. This dependency property
@ -82,7 +82,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// DropDownContextMenuDataContext Dependency Property /// DropDownContextMenuDataContext Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty DropDownContextMenuDataContextProperty = DependencyProperty.Register( "DropDownContextMenuDataContext", typeof( object ), typeof( DropDownButton ), public static readonly DependencyProperty DropDownContextMenuDataContextProperty = DependencyProperty.Register( "DropDownContextMenuDataContext", typeof( object ), typeof( DropDownButton ),
new FrameworkPropertyMetadata( ( object )null ) ); new FrameworkPropertyMetadata( ( object )null ) );
/// <summary> /// <summary>

156
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs

@ -131,98 +131,98 @@ namespace Xceed.Wpf.AvalonDock.Controls
_openUpTimer = null; _openUpTimer = null;
_model.Root.Manager.ShowAutoHideWindow( this ); _model.Root.Manager.ShowAutoHideWindow( this );
if (!_manuallyOpened) if( !_manuallyOpened )
{ {
_clickGracePeriodTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle); _clickGracePeriodTimer = new DispatcherTimer( DispatcherPriority.ApplicationIdle );
_clickGracePeriodTimer.Interval = TimeSpan.FromMilliseconds(1000); _clickGracePeriodTimer.Interval = TimeSpan.FromMilliseconds( 1000 );
_inGracePeriod = true; _inGracePeriod = true;
_clickGracePeriodTimer.Tick += new EventHandler(_clickGracePeriodTimer_Tick); _clickGracePeriodTimer.Tick += new EventHandler( _clickGracePeriodTimer_Tick );
_clickGracePeriodTimer.Start(); _clickGracePeriodTimer.Start();
} }
_manuallyOpened = false;
}
private void _clickGracePeriodTimer_Tick(object sender, EventArgs e)
{
StopGraceTimer();
}
private void StopGraceTimer()
{
_clickGracePeriodTimer.Tick -= new EventHandler(_clickGracePeriodTimer_Tick);
_clickGracePeriodTimer.Stop();
_clickGracePeriodTimer = null;
_inGracePeriod = false;
}
#endregion
#region Overrides
//protected override void OnVisualParentChanged(DependencyObject oldParent)
//{
// base.OnVisualParentChanged(oldParent);
// var contentModel = _model; _manuallyOpened = false;
}
// if (oldParent != null && contentModel != null && contentModel.Content is UIElement) private void _clickGracePeriodTimer_Tick( object sender, EventArgs e )
// { {
// var oldParentPaneControl = oldParent.FindVisualAncestor<LayoutAnchorablePaneControl>(); StopGraceTimer();
// if (oldParentPaneControl != null) }
// {
// ((ILogicalChildrenContainer)oldParentPaneControl).InternalRemoveLogicalChild(contentModel.Content);
// }
// }
// if (contentModel.Content != null && contentModel.Content is UIElement) private void StopGraceTimer()
// { {
// var oldLogicalParentPaneControl = LogicalTreeHelper.GetParent(contentModel.Content as UIElement) _clickGracePeriodTimer.Tick -= new EventHandler( _clickGracePeriodTimer_Tick );
// as ILogicalChildrenContainer; _clickGracePeriodTimer.Stop();
// if (oldLogicalParentPaneControl != null) _clickGracePeriodTimer = null;
// oldLogicalParentPaneControl.InternalRemoveLogicalChild(contentModel.Content); _inGracePeriod = false;
// } }
// if (contentModel != null && contentModel.Content != null && contentModel.Root != null && contentModel.Content is UIElement) #endregion
// {
// ((ILogicalChildrenContainer)contentModel.Root.Manager).InternalAddLogicalChild(contentModel.Content);
// }
//}
protected override void OnMouseDown( System.Windows.Input.MouseButtonEventArgs e ) #region Overrides
//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<LayoutAnchorablePaneControl>();
// 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 ); base.OnMouseDown( e );
if (!e.Handled) if( !e.Handled )
{ {
if (_model.Root.Manager.AutoHideWindow.Visibility != Visibility.Visible) if( _model.Root.Manager.AutoHideWindow.Visibility != Visibility.Visible )
{ {
_model.Root.Manager.ShowAutoHideWindow(this); _model.Root.Manager.ShowAutoHideWindow( this );
_model.IsActive = true; _model.IsActive = true;
_manuallyOpened = true; _manuallyOpened = true;
} }
else else
{ {
if (!_inGracePeriod) if( !_inGracePeriod )
{ {
_model.Root.Manager.HideAutoHideWindow(this); _model.Root.Manager.HideAutoHideWindow( this );
} }
}
}
} }
}
}
protected override void OnMouseEnter( System.Windows.Input.MouseEventArgs e ) protected override void OnMouseEnter( System.Windows.Input.MouseEventArgs e )
{ {
base.OnMouseEnter( e ); base.OnMouseEnter( e );
if (!e.Handled) if( !e.Handled )
{ {
_openUpTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle); _openUpTimer = new DispatcherTimer( DispatcherPriority.ApplicationIdle );
_openUpTimer.Interval = TimeSpan.FromMilliseconds(400); _openUpTimer.Interval = TimeSpan.FromMilliseconds( 400 );
_openUpTimer.Tick += new EventHandler(_openUpTimer_Tick); _openUpTimer.Tick += new EventHandler( _openUpTimer_Tick );
_openUpTimer.Start(); _openUpTimer.Start();
} }
} }
protected override void OnMouseLeave( System.Windows.Input.MouseEventArgs e ) protected override void OnMouseLeave( System.Windows.Input.MouseEventArgs e )
{ {

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableControl.cs

@ -44,7 +44,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// Model Dependency Property /// Model Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutAnchorable ), typeof( LayoutAnchorableControl ), public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutAnchorable ), typeof( LayoutAnchorableControl ),
new FrameworkPropertyMetadata( ( LayoutAnchorable )null, new PropertyChangedCallback( OnModelChanged ) ) ); new FrameworkPropertyMetadata( ( LayoutAnchorable )null, new PropertyChangedCallback( OnModelChanged ) ) );
/// <summary> /// <summary>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableFloatingWindowControl.cs

@ -199,10 +199,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal override void UpdateThemeResources( Xceed.Wpf.AvalonDock.Themes.Theme oldTheme = null ) internal override void UpdateThemeResources( Xceed.Wpf.AvalonDock.Themes.Theme oldTheme = null )
{ {
if (Application.Current != null) if( Application.Current != null )
return; return;
base.UpdateThemeResources( oldTheme ); base.UpdateThemeResources( oldTheme );
if( _overlayWindow != null ) if( _overlayWindow != null )
{ {

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableItem.cs

@ -222,13 +222,13 @@ namespace Xceed.Wpf.AvalonDock.Controls
return value; return value;
} }
private bool CanExecuteDockCommand(object parameter) private bool CanExecuteDockCommand( object parameter )
{ {
if (LayoutElement == null) if( LayoutElement == null )
return false; return false;
return LayoutElement.CanDock && LayoutElement.FindParent<LayoutAnchorableFloatingWindow>() != null; return LayoutElement.CanDock && LayoutElement.FindParent<LayoutAnchorableFloatingWindow>() != null;
} }
private void ExecuteDockCommand( object parameter ) private void ExecuteDockCommand( object parameter )
{ {

36
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs

@ -164,26 +164,26 @@ namespace Xceed.Wpf.AvalonDock.Controls
return new HandleRef( this, _internalHwndSource.Handle ); return new HandleRef( this, _internalHwndSource.Handle );
} }
protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) protected override IntPtr WndProc( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled )
{
// Make sure that autohide windows always display on top of other Controls
// (even Win32 control which WPF cannot normally overlay!)
if( msg == Win32Helper.WM_WINDOWPOSCHANGING )
{
// APD Fix - Stop a recursive call to WndProc when the window has been destroyed
// It was making a call to SetWindowPos which could cause a stack overflow.
if( _internalHost_ContentRendered )
{ {
// Make sure that autohide windows always display on top of other Controls Win32Helper.WINDOWPOS mwp = ( Win32Helper.WINDOWPOS )Marshal.PtrToStructure( lParam, typeof( Win32Helper.WINDOWPOS ) );
// (even Win32 control which WPF cannot normally overlay!)
if (msg == Win32Helper.WM_WINDOWPOSCHANGING) mwp.hwndInsertAfter = Win32Helper.HWND_TOP;
{ mwp.flags = mwp.flags & ~( int )Win32Helper.SetWindowPosFlags.IgnoreZOrder;
// APD Fix - Stop a recursive call to WndProc when the window has been destroyed
// It was making a call to SetWindowPos which could cause a stack overflow. Marshal.StructureToPtr( mwp, lParam, true );
if (_internalHost_ContentRendered)
{
Win32Helper.WINDOWPOS mwp = (Win32Helper.WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(Win32Helper.WINDOWPOS));
mwp.hwndInsertAfter = Win32Helper.HWND_TOP;
mwp.flags = mwp.flags & ~(int)Win32Helper.SetWindowPosFlags.IgnoreZOrder;
Marshal.StructureToPtr(mwp, lParam, true);
}
}
return base.WndProc(hwnd, msg, wParam, lParam, ref handled);
} }
}
return base.WndProc( hwnd, msg, wParam, lParam, ref handled );
}
protected override void DestroyWindowCore( System.Runtime.InteropServices.HandleRef hwnd ) protected override void DestroyWindowCore( System.Runtime.InteropServices.HandleRef hwnd )
{ {

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentControl.cs

@ -115,7 +115,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// LayoutItem Read-Only Dependency Property /// LayoutItem Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey LayoutItemPropertyKey = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( LayoutDocumentControl ), private static readonly DependencyPropertyKey LayoutItemPropertyKey = DependencyProperty.RegisterReadOnly( "LayoutItem", typeof( LayoutItem ), typeof( LayoutDocumentControl ),
new FrameworkPropertyMetadata(( LayoutItem )null ) ); new FrameworkPropertyMetadata( ( LayoutItem )null ) );
public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty; public static readonly DependencyProperty LayoutItemProperty = LayoutItemPropertyKey.DependencyProperty;

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentItem.cs

@ -97,7 +97,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
protected override void OnVisibilityChanged() protected override void OnVisibilityChanged()
{ {
if( (_document != null) && (_document.Root != null) ) if( ( _document != null ) && ( _document.Root != null ) )
{ {
_document.IsVisible = ( this.Visibility == Visibility.Visible ); _document.IsVisible = ( this.Visibility == Visibility.Visible );
@ -138,6 +138,6 @@ namespace Xceed.Wpf.AvalonDock.Controls
#endregion #endregion
} }
} }

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs

@ -57,7 +57,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
/// <summary> /// <summary>
/// Model Dependency Property /// Model Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutContent ), typeof( LayoutDocumentTabItem ), public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", typeof( LayoutContent ), typeof( LayoutDocumentTabItem ),
new FrameworkPropertyMetadata( ( LayoutContent )null, new PropertyChangedCallback( OnModelChanged ) ) ); new FrameworkPropertyMetadata( ( LayoutContent )null, new PropertyChangedCallback( OnModelChanged ) ) );
/// <summary> /// <summary>

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

@ -245,10 +245,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal virtual void UpdateThemeResources( Theme oldTheme = null ) internal virtual void UpdateThemeResources( Theme oldTheme = null )
{ {
if (Application.Current != null) if( Application.Current != null )
return; return;
if ( oldTheme != null ) if( oldTheme != null )
{ {
if( oldTheme is DictionaryTheme ) if( oldTheme is DictionaryTheme )
{ {

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutGridControl.cs

@ -67,7 +67,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
return _model; return _model;
} }
} }
public Orientation Orientation public Orientation Orientation
{ {
@ -75,7 +75,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
return ( _model as ILayoutOrientableGroup ).Orientation; return ( _model as ILayoutOrientableGroup ).Orientation;
} }
} }
private bool AsyncRefreshCalled private bool AsyncRefreshCalled
{ {
@ -565,7 +565,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
_resizerWindowHost.Show(); _resizerWindowHost.Show();
} }
private void HideResizerOverlayWindow() private void HideResizerOverlayWindow()
{ {
if( _resizerWindowHost != null ) if( _resizerWindowHost != null )
{ {

70
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs

@ -424,42 +424,42 @@ namespace Xceed.Wpf.AvalonDock.Controls
#endregion #endregion
#region CanDock #region CanDock
public static readonly DependencyProperty CanDockProperty = public static readonly DependencyProperty CanDockProperty =
DependencyProperty.Register("CanDock", typeof(bool), typeof(LayoutItem), DependencyProperty.Register( "CanDock", typeof( bool ), typeof( LayoutItem ),
new FrameworkPropertyMetadata(true, new FrameworkPropertyMetadata( true,
new PropertyChangedCallback(OnCanDockChanged))); new PropertyChangedCallback( OnCanDockChanged ) ) );
public bool CanDock public bool CanDock
{ {
get { return (bool)GetValue(CanDockProperty); } get { return ( bool )GetValue( CanDockProperty ); }
set { SetValue(CanDockProperty, value); } set { SetValue( CanDockProperty, value ); }
} }
private static void OnCanDockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnCanDockChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{ {
((LayoutItem)d).OnCanDockChanged(e); ( ( LayoutItem )d ).OnCanDockChanged( e );
} }
protected virtual void OnCanDockChanged(DependencyPropertyChangedEventArgs e) protected virtual void OnCanDockChanged( DependencyPropertyChangedEventArgs e )
{ {
LayoutElement.CanDock = (bool)e.NewValue; LayoutElement.CanDock = ( bool )e.NewValue;
} }
#endregion #endregion
#endregion #endregion
#region Commands #region Commands
#region CloseCommand #region CloseCommand
/// <summary> /// <summary>
/// CloseCommand Dependency Property /// CloseCommand Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty CloseCommandProperty = DependencyProperty.Register( "CloseCommand", typeof( ICommand ), typeof( LayoutItem ), public static readonly DependencyProperty CloseCommandProperty = DependencyProperty.Register( "CloseCommand", typeof( ICommand ), typeof( LayoutItem ),
new FrameworkPropertyMetadata( null, new PropertyChangedCallback( OnCloseCommandChanged ), new CoerceValueCallback( CoerceCloseCommandValue ) ) ); new FrameworkPropertyMetadata( null, new PropertyChangedCallback( OnCloseCommandChanged ), new CoerceValueCallback( CoerceCloseCommandValue ) ) );
/// <summary> /// <summary>
/// Gets or sets the CloseCommand property. This dependency property /// Gets or sets the CloseCommand property. This dependency property
@ -627,10 +627,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
return value; return value;
} }
private bool CanExecuteDockAsDocumentCommand(object parameter) private bool CanExecuteDockAsDocumentCommand( object parameter )
{ {
return LayoutElement != null && LayoutElement.CanDock && LayoutElement.FindParent<LayoutDocumentPane>() == null; return LayoutElement != null && LayoutElement.CanDock && LayoutElement.FindParent<LayoutDocumentPane>() == null;
} }
private void ExecuteDockAsDocumentCommand( object parameter ) private void ExecuteDockAsDocumentCommand( object parameter )
{ {
@ -1109,13 +1109,13 @@ namespace Xceed.Wpf.AvalonDock.Controls
layoutElement.IsActive = true; layoutElement.IsActive = true;
layoutElement.Root.CollectGarbage(); layoutElement.Root.CollectGarbage();
} }
#endregion #endregion
#endregion #endregion
#region Internal Methods #region Internal Methods
protected virtual void InitDefaultCommands() protected virtual void InitDefaultCommands()
{ {
_defaultCloseCommand = new RelayCommand( ( p ) => ExecuteCloseCommand( p ), ( p ) => CanExecuteCloseCommand( p ) ); _defaultCloseCommand = new RelayCommand( ( p ) => ExecuteCloseCommand( p ), ( p ) => CanExecuteCloseCommand( p ) );
_defaultFloatCommand = new RelayCommand( ( p ) => ExecuteFloatCommand( p ), ( p ) => CanExecuteFloatCommand( p ) ); _defaultFloatCommand = new RelayCommand( ( p ) => ExecuteFloatCommand( p ), ( p ) => CanExecuteFloatCommand( p ) );

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/NavigatorWindow.cs

@ -249,7 +249,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
bool shouldHandle = false; bool shouldHandle = false;
// Press Tab to switch Selected LayoutContent. // Press Tab to switch Selected LayoutContent.
if( e.Key == System.Windows.Input.Key.Tab) if( e.Key == System.Windows.Input.Key.Tab )
{ {
// Selecting LayoutDocuments // Selecting LayoutDocuments
if( _isSelectingDocument ) if( _isSelectingDocument )
@ -258,7 +258,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
// Jump to next LayoutDocument // Jump to next LayoutDocument
var docIndex = this.Documents.IndexOf<LayoutDocumentItem>( this.SelectedDocument ); var docIndex = this.Documents.IndexOf<LayoutDocumentItem>( this.SelectedDocument );
if( docIndex < (this.Documents.Length - 1) ) if( docIndex < ( this.Documents.Length - 1 ) )
{ {
this.SelectNextDocument(); this.SelectNextDocument();
shouldHandle = true; shouldHandle = true;
@ -289,7 +289,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
// Jump to next LayoutAnchorable // Jump to next LayoutAnchorable
var anchorableIndex = this.Anchorables.ToArray().IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable ); var anchorableIndex = this.Anchorables.ToArray().IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable );
if( anchorableIndex < (this.Anchorables.Count() - 1) ) if( anchorableIndex < ( this.Anchorables.Count() - 1 ) )
{ {
this.SelectNextAnchorable(); this.SelectNextAnchorable();
shouldHandle = true; shouldHandle = true;
@ -374,10 +374,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void UpdateThemeResources( Theme oldTheme = null ) internal void UpdateThemeResources( Theme oldTheme = null )
{ {
if (Application.Current != null) if( Application.Current != null )
return; return;
if ( oldTheme != null ) if( oldTheme != null )
{ {
if( oldTheme is DictionaryTheme ) if( oldTheme is DictionaryTheme )
{ {
@ -472,11 +472,11 @@ namespace Xceed.Wpf.AvalonDock.Controls
{ {
this.Loaded -= new RoutedEventHandler( OnLoaded ); this.Loaded -= new RoutedEventHandler( OnLoaded );
if( ( _documentListBox != null ) && (this.SelectedDocument != null) ) if( ( _documentListBox != null ) && ( this.SelectedDocument != null ) )
{ {
_documentListBox.Focus(); _documentListBox.Focus();
} }
else if( ( _anchorableListBox != null ) && (this.SelectedAnchorable != null) ) else if( ( _anchorableListBox != null ) && ( this.SelectedAnchorable != null ) )
{ {
_anchorableListBox.Focus(); _anchorableListBox.Focus();
} }

114
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/OverlayWindow.cs

@ -151,10 +151,10 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void UpdateThemeResources( Theme oldTheme = null ) internal void UpdateThemeResources( Theme oldTheme = null )
{ {
if (Application.Current != null) if( Application.Current != null )
return; return;
if ( oldTheme != null ) if( oldTheme != null )
{ {
if( oldTheme is DictionaryTheme ) if( oldTheme is DictionaryTheme )
{ {
@ -518,25 +518,25 @@ namespace Xceed.Wpf.AvalonDock.Controls
var layoutDocumentPane = ( dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPaneGroup ).Children.First() as LayoutDocumentPane; var layoutDocumentPane = ( dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPaneGroup ).Children.First() as LayoutDocumentPane;
var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup; var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup;
_documentPaneDropTargetLeft.Visibility = Visibility.Hidden; _documentPaneDropTargetLeft.Visibility = Visibility.Hidden;
_documentPaneDropTargetRight.Visibility = Visibility.Hidden; _documentPaneDropTargetRight.Visibility = Visibility.Hidden;
_documentPaneDropTargetTop.Visibility = Visibility.Hidden; _documentPaneDropTargetTop.Visibility = Visibility.Hidden;
_documentPaneDropTargetBottom.Visibility = Visibility.Hidden; _documentPaneDropTargetBottom.Visibility = Visibility.Hidden;
} }
break; break;
case DropAreaType.DocumentPane: case DropAreaType.DocumentPane:
default: default:
{ {
bool isDraggingAnchorables = false; bool isDraggingAnchorables = false;
if (_floatingWindow != null) if( _floatingWindow != null )
isDraggingAnchorables = _floatingWindow.Model is LayoutAnchorableFloatingWindow; isDraggingAnchorables = _floatingWindow.Model is LayoutAnchorableFloatingWindow;
if (isDraggingAnchorables && _gridDocumentPaneFullDropTargets != null) if( isDraggingAnchorables && _gridDocumentPaneFullDropTargets != null )
{ {
areaElement = _gridDocumentPaneFullDropTargets; areaElement = _gridDocumentPaneFullDropTargets;
var dropAreaDocumentPaneGroup = area as DropArea<LayoutDocumentPaneControl>; var dropAreaDocumentPaneGroup = area as DropArea<LayoutDocumentPaneControl>;
var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane; var layoutDocumentPane = dropAreaDocumentPaneGroup.AreaElement.Model as LayoutDocumentPane;
var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup; var parentDocumentPaneGroup = layoutDocumentPane.Parent as LayoutDocumentPaneGroup;
SetDropTargetIntoVisibility( layoutDocumentPane ); SetDropTargetIntoVisibility( layoutDocumentPane );
@ -672,46 +672,46 @@ namespace Xceed.Wpf.AvalonDock.Controls
break; break;
} }
if (areaElement != null) if( areaElement != null )
{ {
Canvas.SetLeft(areaElement, area.DetectionRect.Left - Left); Canvas.SetLeft( areaElement, area.DetectionRect.Left - Left );
Canvas.SetTop(areaElement, area.DetectionRect.Top - Top); Canvas.SetTop( areaElement, area.DetectionRect.Top - Top );
areaElement.Width = area.DetectionRect.Width; areaElement.Width = area.DetectionRect.Width;
areaElement.Height = area.DetectionRect.Height; areaElement.Height = area.DetectionRect.Height;
areaElement.Visibility = System.Windows.Visibility.Visible; areaElement.Visibility = System.Windows.Visibility.Visible;
} }
} }
void IOverlayWindow.DragLeave( IDropArea area ) void IOverlayWindow.DragLeave( IDropArea area )
{ {
_visibleAreas.Remove( area ); _visibleAreas.Remove( area );
FrameworkElement areaElement; FrameworkElement areaElement;
switch (area.Type) switch( area.Type )
{ {
case DropAreaType.DockingManager: case DropAreaType.DockingManager:
areaElement = _gridDockingManagerDropTargets; areaElement = _gridDockingManagerDropTargets;
break; break;
case DropAreaType.AnchorablePane: case DropAreaType.AnchorablePane:
areaElement = _gridAnchorablePaneDropTargets; areaElement = _gridAnchorablePaneDropTargets;
break; break;
case DropAreaType.DocumentPaneGroup: case DropAreaType.DocumentPaneGroup:
areaElement = _gridDocumentPaneDropTargets; areaElement = _gridDocumentPaneDropTargets;
break; break;
case DropAreaType.DocumentPane: case DropAreaType.DocumentPane:
default: default:
{ {
bool isDraggingAnchorables = false; bool isDraggingAnchorables = false;
if (_floatingWindow != null) if( _floatingWindow != null )
isDraggingAnchorables = _floatingWindow.Model is LayoutAnchorableFloatingWindow; isDraggingAnchorables = _floatingWindow.Model is LayoutAnchorableFloatingWindow;
if (isDraggingAnchorables && _gridDocumentPaneFullDropTargets != null) if( isDraggingAnchorables && _gridDocumentPaneFullDropTargets != null )
areaElement = _gridDocumentPaneFullDropTargets; areaElement = _gridDocumentPaneFullDropTargets;
else else
areaElement = _gridDocumentPaneDropTargets; areaElement = _gridDocumentPaneDropTargets;
} }
break; break;
} }
areaElement.Visibility = System.Windows.Visibility.Hidden; areaElement.Visibility = System.Windows.Visibility.Hidden;
} }

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

@ -52,7 +52,7 @@ namespace Xceed.Wpf.AvalonDock
private NavigatorWindow _navigatorWindow = null; private NavigatorWindow _navigatorWindow = null;
internal bool SuspendDocumentsSourceBinding = false; internal bool SuspendDocumentsSourceBinding = false;
internal bool SuspendAnchorablesSourceBinding = false; internal bool SuspendAnchorablesSourceBinding = false;
#endregion #endregion
@ -156,8 +156,8 @@ namespace Xceed.Wpf.AvalonDock
ClearLogicalChildrenList(); ClearLogicalChildrenList();
DetachLayoutItems(); DetachLayoutItems();
ActiveContent = null; ActiveContent = null;
Layout.Manager = this; Layout.Manager = this;
AttachLayoutItems(); AttachLayoutItems();
AttachDocumentsSource( newLayout, DocumentsSource ); AttachDocumentsSource( newLayout, DocumentsSource );
@ -200,15 +200,15 @@ namespace Xceed.Wpf.AvalonDock
CommandManager.InvalidateRequerySuggested(); CommandManager.InvalidateRequerySuggested();
} }
#endregion #endregion
#region LayoutUpdateStrategy #region LayoutUpdateStrategy
/// <summary> /// <summary>
/// LayoutUpdateStrategy Dependency Property /// LayoutUpdateStrategy Dependency Property
/// </summary> /// </summary>
public static readonly DependencyProperty LayoutUpdateStrategyProperty = DependencyProperty.Register( "LayoutUpdateStrategy", typeof( ILayoutUpdateStrategy ), typeof( DockingManager ), public static readonly DependencyProperty LayoutUpdateStrategyProperty = DependencyProperty.Register( "LayoutUpdateStrategy", typeof( ILayoutUpdateStrategy ), typeof( DockingManager ),
new FrameworkPropertyMetadata( ( ILayoutUpdateStrategy )null ) ); new FrameworkPropertyMetadata( ( ILayoutUpdateStrategy )null ) );
/// <summary> /// <summary>
/// Gets or sets the LayoutUpdateStrategy property. This dependency property /// Gets or sets the LayoutUpdateStrategy property. This dependency property
@ -1131,10 +1131,10 @@ namespace Xceed.Wpf.AvalonDock
if( _logicalChildren.Select( ch => ch.GetValueOrDefault<object>() ).Contains( element ) ) if( _logicalChildren.Select( ch => ch.GetValueOrDefault<object>() ).Contains( element ) )
return; return;
if (((FrameworkElement)element).Parent != null) if( ( ( FrameworkElement )element ).Parent != null )
{ {
(((FrameworkElement)element).Parent as DockingManager).InternalRemoveLogicalChild(element); ( ( ( FrameworkElement )element ).Parent as DockingManager ).InternalRemoveLogicalChild( element );
} }
_logicalChildren.Add( new WeakReference( element ) ); _logicalChildren.Add( new WeakReference( element ) );
AddLogicalChild( element ); AddLogicalChild( element );
@ -1528,8 +1528,8 @@ namespace Xceed.Wpf.AvalonDock
{ {
var oldTheme = e.OldValue as Theme; var oldTheme = e.OldValue as Theme;
var newTheme = e.NewValue as Theme; var newTheme = e.NewValue as Theme;
var resources = Application.Current == null ? this.Resources : Application.Current.Resources; var resources = Application.Current == null ? this.Resources : Application.Current.Resources;
if ( oldTheme != null ) if( oldTheme != null )
{ {
if( oldTheme is DictionaryTheme ) if( oldTheme is DictionaryTheme )
{ {
@ -1562,17 +1562,17 @@ namespace Xceed.Wpf.AvalonDock
} }
} }
if (Application.Current == null) if( Application.Current == null )
{ {
foreach (var fwc in _fwList) foreach( var fwc in _fwList )
fwc.UpdateThemeResources(oldTheme); fwc.UpdateThemeResources( oldTheme );
if (_navigatorWindow != null) if( _navigatorWindow != null )
_navigatorWindow.UpdateThemeResources(); _navigatorWindow.UpdateThemeResources();
if (_overlayWindow != null) if( _overlayWindow != null )
_overlayWindow.UpdateThemeResources(); _overlayWindow.UpdateThemeResources();
} }
} }
#endregion #endregion
@ -1937,11 +1937,11 @@ namespace Xceed.Wpf.AvalonDock
} }
} }
#endregion #endregion
#region Overrides #region Overrides
public override void OnApplyTemplate() public override void OnApplyTemplate()
{ {
base.OnApplyTemplate(); base.OnApplyTemplate();
@ -3253,8 +3253,8 @@ namespace Xceed.Wpf.AvalonDock
bool IOverlayWindowHost.HitTest( Point dragPoint ) bool IOverlayWindowHost.HitTest( Point dragPoint )
{ {
if (!this.IsVisible) return false; if( !this.IsVisible ) return false;
Rect detectionRect = new Rect( this.PointToScreenDPIWithoutFlowDirection( new Point() ), this.TransformActualSizeToAncestor() ); Rect detectionRect = new Rect( this.PointToScreenDPIWithoutFlowDirection( new Point() ), this.TransformActualSizeToAncestor() );
return detectionRect.Contains( dragPoint ); return detectionRect.Contains( dragPoint );
} }
@ -3269,12 +3269,12 @@ namespace Xceed.Wpf.AvalonDock
IOverlayWindow IOverlayWindowHost.ShowOverlayWindow( LayoutFloatingWindowControl draggingWindow ) IOverlayWindow IOverlayWindowHost.ShowOverlayWindow( LayoutFloatingWindowControl draggingWindow )
{ {
CreateOverlayWindow(); CreateOverlayWindow();
if (draggingWindow.Model.Root.ActiveContent.CanDock) if( draggingWindow.Model.Root.ActiveContent.CanDock )
{ {
_overlayWindow.Owner = draggingWindow; _overlayWindow.Owner = draggingWindow;
_overlayWindow.EnableDropTargets(); _overlayWindow.EnableDropTargets();
_overlayWindow.Show(); _overlayWindow.Show();
} }
return _overlayWindow; return _overlayWindow;
} }

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/Extentions.cs

@ -96,7 +96,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
layoutPanel = parentContainer.FindParent<LayoutPanel>(); layoutPanel = parentContainer.FindParent<LayoutPanel>();
} }
if( (layoutPanel != null) && ( layoutPanel.Children.Count > 0 ) ) if( ( layoutPanel != null ) && ( layoutPanel.Children.Count > 0 ) )
{ {
if( layoutPanel.Orientation == System.Windows.Controls.Orientation.Horizontal ) if( layoutPanel.Orientation == System.Windows.Controls.Orientation.Horizontal )
return layoutPanel.Children[ 0 ].Descendents().Contains( element ) ? AnchorSide.Left : AnchorSide.Right; return layoutPanel.Children[ 0 ].Descendents().Contains( element ) ? AnchorSide.Left : AnchorSide.Right;

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

@ -355,11 +355,11 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "Anchorable()" ); System.Diagnostics.Trace.WriteLine( "Anchorable()" );
} }
#endif #endif
#endregion #endregion

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorableFloatingWindow.cs

@ -228,13 +228,13 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "FloatingAnchorableWindow()" ); System.Diagnostics.Trace.WriteLine( "FloatingAnchorableWindow()" );
RootPanel.ConsoleDump(tab + 1); RootPanel.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

14
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorablePane.cs

@ -232,14 +232,14 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "AnchorablePane()" ); System.Diagnostics.Trace.WriteLine( "AnchorablePane()" );
foreach (LayoutElement child in Children) foreach( LayoutElement child in Children )
child.ConsoleDump(tab + 1); child.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

14
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorablePaneGroup.cs

@ -115,14 +115,14 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( string.Format( "AnchorablePaneGroup({0})", Orientation ) ); System.Diagnostics.Trace.WriteLine( string.Format( "AnchorablePaneGroup({0})", Orientation ) );
foreach (LayoutElement child in Children) foreach( LayoutElement child in Children )
child.ConsoleDump(tab + 1); child.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

82
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs

@ -42,7 +42,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
#region Title #region Title
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( "Title", typeof( string ), typeof( LayoutContent ), new UIPropertyMetadata( null, OnTitlePropertyChanged, CoerceTitleValue ) ); public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( "Title", typeof( string ), typeof( LayoutContent ), new UIPropertyMetadata( null, OnTitlePropertyChanged, CoerceTitleValue ) );
public string Title public string Title
{ {
@ -539,29 +539,29 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
} }
#endregion #endregion
#region CanDock #region CanDock
private bool _canDock = true; private bool _canDock = true;
public bool CanDock public bool CanDock
{ {
get { return _canDock; } get { return _canDock; }
set set
{ {
if (_canDock != value) if( _canDock != value )
{ {
_canDock = value; _canDock = value;
RaisePropertyChanged("CanDock"); RaisePropertyChanged( "CanDock" );
} }
} }
} }
#endregion #endregion
#region IsEnabled #region IsEnabled
private bool _isEnabled = true; private bool _isEnabled = true;
public bool IsEnabled public bool IsEnabled
{ {
get get
@ -578,7 +578,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
} }
#endregion #endregion
@ -586,11 +586,11 @@ namespace Xceed.Wpf.AvalonDock.Layout
#endregion #endregion
#region Overrides #region Overrides
protected override void OnParentChanging( ILayoutContainer oldValue, ILayoutContainer newValue ) protected override void OnParentChanging( ILayoutContainer oldValue, ILayoutContainer newValue )
{ {
var root = Root; var root = Root;
@ -789,22 +789,22 @@ namespace Xceed.Wpf.AvalonDock.Layout
return; return;
} }
LayoutDocumentPane newParentPane; LayoutDocumentPane newParentPane;
if (root.LastFocusedDocument != null) if( root.LastFocusedDocument != null )
{ {
newParentPane = root.LastFocusedDocument.Parent as LayoutDocumentPane; newParentPane = root.LastFocusedDocument.Parent as LayoutDocumentPane;
// LastFocusedDocument's parent isn't always a DocumentPane for some reason. // LastFocusedDocument's parent isn't always a DocumentPane for some reason.
// Attempt to find one when this happens. // Attempt to find one when this happens.
if (newParentPane == null) if( newParentPane == null )
{ {
newParentPane = root.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault(); newParentPane = root.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
} }
} }
else else
{ {
newParentPane = root.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault(); newParentPane = root.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
} }
if( newParentPane != null ) if( newParentPane != null )
{ {
@ -886,10 +886,10 @@ namespace Xceed.Wpf.AvalonDock.Layout
var parentAsContainer = Parent as ILayoutContainer; var parentAsContainer = Parent as ILayoutContainer;
parentAsContainer.RemoveChild( this ); parentAsContainer.RemoveChild( this );
if (Content is IDisposable contentAsDisposable) if( Content is IDisposable contentAsDisposable )
contentAsDisposable.Dispose(); contentAsDisposable.Dispose();
if ( root != null ) if( root != null )
root.CollectGarbage(); root.CollectGarbage();
OnClosed(); OnClosed();

10
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocument.cs

@ -98,11 +98,11 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "Document()" ); System.Diagnostics.Trace.WriteLine( "Document()" );
} }
#endif #endif
protected override void InternalDock() protected override void InternalDock()

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentFloatingWindow.cs

@ -154,13 +154,13 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "FloatingDocumentWindow()" ); System.Diagnostics.Trace.WriteLine( "FloatingDocumentWindow()" );
RootDocument.ConsoleDump(tab + 1); RootDocument.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

14
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentPane.cs

@ -200,14 +200,14 @@ namespace Xceed.Wpf.AvalonDock.Layout
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "DocumentPane()" ); System.Diagnostics.Trace.WriteLine( "DocumentPane()" );
foreach (LayoutElement child in Children) foreach( LayoutElement child in Children )
child.ConsoleDump(tab + 1); child.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

14
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentPaneGroup.cs

@ -84,14 +84,14 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( string.Format( "DocumentPaneGroup({0})", Orientation ) ); System.Diagnostics.Trace.WriteLine( string.Format( "DocumentPaneGroup({0})", Orientation ) );
foreach (LayoutElement child in Children) foreach( LayoutElement child in Children )
child.ConsoleDump(tab + 1); child.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

10
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutElement.cs

@ -102,11 +102,11 @@ namespace Xceed.Wpf.AvalonDock.Layout
#region Public Methods #region Public Methods
#if TRACE #if TRACE
public virtual void ConsoleDump(int tab) public virtual void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new String( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new String( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( this.ToString() ); System.Diagnostics.Trace.WriteLine( this.ToString() );
} }
#endif #endif
#endregion #endregion

14
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutPanel.cs

@ -85,14 +85,14 @@ namespace Xceed.Wpf.AvalonDock.Layout
} }
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( string.Format( "Panel({0})", Orientation ) ); System.Diagnostics.Trace.WriteLine( string.Format( "Panel({0})", Orientation ) );
foreach (LayoutElement child in Children) foreach( LayoutElement child in Children )
child.ConsoleDump(tab + 1); child.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutRoot.cs

@ -351,25 +351,25 @@ namespace Xceed.Wpf.AvalonDock.Layout
#region Overrides #region Overrides
#if TRACE #if TRACE
public override void ConsoleDump(int tab) public override void ConsoleDump( int tab )
{ {
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "RootPanel()" ); System.Diagnostics.Trace.WriteLine( "RootPanel()" );
RootPanel.ConsoleDump(tab + 1); RootPanel.ConsoleDump( tab + 1 );
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "FloatingWindows()" ); System.Diagnostics.Trace.WriteLine( "FloatingWindows()" );
foreach (LayoutFloatingWindow fw in FloatingWindows) foreach( LayoutFloatingWindow fw in FloatingWindows )
fw.ConsoleDump(tab + 1); fw.ConsoleDump( tab + 1 );
System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) ); System.Diagnostics.Trace.Write( new string( ' ', tab * 4 ) );
System.Diagnostics.Trace.WriteLine( "Hidden()" ); System.Diagnostics.Trace.WriteLine( "Hidden()" );
foreach (LayoutAnchorable hidden in Hidden) foreach( LayoutAnchorable hidden in Hidden )
hidden.ConsoleDump(tab + 1); hidden.ConsoleDump( tab + 1 );
} }
#endif #endif
#endregion #endregion
@ -607,7 +607,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
System.Diagnostics.Debug.Assert( System.Diagnostics.Debug.Assert(
!this.Descendents().OfType<LayoutAnchorablePane>().Any( a => a.ChildrenCount == 0 && a.IsVisible ) ); !this.Descendents().OfType<LayoutAnchorablePane>().Any( a => a.ChildrenCount == 0 && a.IsVisible ) );
#if TRACE #if TRACE
RootPanel.ConsoleDump(4); RootPanel.ConsoleDump( 4 );
#endif #endif
#endif #endif
} }
@ -906,7 +906,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
if( reader.LocalName.Equals( "RootPanel" ) ) if( reader.LocalName.Equals( "RootPanel" ) )
{ {
orientation = (reader.GetAttribute( "Orientation" ) == "Vertical") ? Orientation.Vertical : Orientation.Horizontal; orientation = ( reader.GetAttribute( "Orientation" ) == "Vertical" ) ? Orientation.Vertical : Orientation.Horizontal;
reader.Read(); reader.Read();
while( true ) while( true )

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

@ -38,7 +38,7 @@ using System;
// Setting ComVisible to false makes the types in this assembly not visible // Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible( false )]
[assembly: CLSCompliant( true )] [assembly: CLSCompliant( true )]
//In order to begin building localizable applications, set //In order to begin building localizable applications, set
@ -53,11 +53,11 @@ using System;
[assembly: ThemeInfo( [assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page, //(used if a resource is not found in the page,
// or application resource dictionaries) // or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page, //(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries) // app, or any theme specific resource dictionaries)
)] )]
[assembly: XmlnsPrefix( "http://schemas.xceed.com/wpf/xaml/avalondock", "xcad" )] [assembly: XmlnsPrefix( "http://schemas.xceed.com/wpf/xaml/avalondock", "xcad" )]

Loading…
Cancel
Save