diff --git a/ExtendedWPFToolkitSolution/Libs/NET35/WPFToolkit.dll b/ExtendedWPFToolkitSolution/Libs/NET35/WPFToolkit.dll new file mode 100644 index 00000000..89b123cc Binary files /dev/null and b/ExtendedWPFToolkitSolution/Libs/NET35/WPFToolkit.dll differ diff --git a/ExtendedWPFToolkitSolution/Libs/NET35/Xceed.Wpf.Toolkit.dll b/ExtendedWPFToolkitSolution/Libs/NET35/Xceed.Wpf.Toolkit.dll new file mode 100644 index 00000000..3c629010 Binary files /dev/null and b/ExtendedWPFToolkitSolution/Libs/NET35/Xceed.Wpf.Toolkit.dll differ diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml index 3e3752e1..c8790d43 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml @@ -1314,10 +1314,10 @@ + Value="3" /> - + Value="3" /> - diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml index be965027..9af2c16c 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Metro/Theme.xaml @@ -1357,11 +1357,11 @@ + Value="3" /> @@ -1548,11 +1548,11 @@ + Value="3" /> diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml index 289ce722..927d2f5b 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.VS2010/Theme.xaml @@ -1456,10 +1456,10 @@ + Value="3" /> - + Value="3" /> - diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropTarget.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropTarget.cs index b458838f..a3c5ab4d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropTarget.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/DropTarget.cs @@ -99,16 +99,32 @@ namespace Xceed.Wpf.AvalonDock.Controls { var root = floatingWindow.Root; var currentActiveContent = floatingWindow.Root.ActiveContent; + var manager = root.Manager; var fwAsAnchorable = floatingWindow as LayoutAnchorableFloatingWindow; if( fwAsAnchorable != null ) { + // Raise PreviewDock Event + var draggedLayoutAnchorable = floatingWindow.Descendents().OfType().FirstOrDefault( l => l != null ); + manager.RaisePreviewDockEvent( draggedLayoutAnchorable ); + this.Drop( fwAsAnchorable ); + + // Raise Dock Event + manager.RaiseDockedEvent( draggedLayoutAnchorable ); } else { var fwAsDocument = floatingWindow as LayoutDocumentFloatingWindow; + + // Raise PreviewDock Event + var draggedLayoutDocument = floatingWindow.Descendents().OfType().FirstOrDefault( l => l != null ); + manager.RaisePreviewDockEvent( draggedLayoutDocument ); + this.Drop( fwAsDocument ); + + // Raise Dock Event + manager.RaiseDockedEvent( draggedLayoutDocument ); } if( currentActiveContent != null ) diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/Extentions.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/Extentions.cs index 05a68083..faa6eaa3 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/Extentions.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/Extentions.cs @@ -113,5 +113,14 @@ namespace Xceed.Wpf.AvalonDock.Controls while( target != null && !( target is T ) ); return target as T; } + + public static IEnumerable FindLogicalAncestorsAndSelf( this DependencyObject self ) + { + while( self != null ) + { + yield return self; + self = LogicalTreeHelper.GetParent( self ) ?? VisualTreeHelper.GetParent( self ); + } + } } } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs index bcb10b75..78f03a6d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentTabItem.cs @@ -35,7 +35,7 @@ namespace Xceed.Wpf.AvalonDock.Controls private List _otherTabsScreenArea = null; private List _otherTabs = null; private Rect _parentDocumentTabPanelScreenArea; - private DocumentPaneTabPanel _parentDocumentTabPanel; + private Panel _parentTabPanel; private bool _isMouseDown = false; private Point _mouseDownPoint; private double _mouseLastChangePositionX; @@ -220,7 +220,7 @@ namespace Xceed.Wpf.AvalonDock.Controls containerPane.MoveChild( currentIndex, newIndex ); _dragBuffer = MaxDragBuffer; this.Model.IsActive = true; - _parentDocumentTabPanel.UpdateLayout(); + _parentTabPanel.UpdateLayout(); this.UpdateDragDetails(); _mouseLastChangePositionX = mousePosInScreenCoord.X; } @@ -271,10 +271,19 @@ namespace Xceed.Wpf.AvalonDock.Controls private void UpdateDragDetails() { - _parentDocumentTabPanel = this.FindLogicalAncestor(); - _parentDocumentTabPanelScreenArea = _parentDocumentTabPanel.GetScreenArea(); + _parentTabPanel = this.FindLogicalAncestor(); + + if( _parentTabPanel == null ) + { + _parentTabPanel = this.GetParentPanel(); + } + + if( _parentTabPanel == null ) + return; + + _parentDocumentTabPanelScreenArea = _parentTabPanel.GetScreenArea(); _parentDocumentTabPanelScreenArea.Inflate( 0, _dragBuffer ); - _otherTabs = _parentDocumentTabPanel.Children.Cast().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList(); + _otherTabs = _parentTabPanel.Children.Cast().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList(); var currentTabScreenArea = this.FindLogicalAncestor().GetScreenArea(); _otherTabsScreenArea = _otherTabs.Select( ti => { @@ -285,6 +294,21 @@ namespace Xceed.Wpf.AvalonDock.Controls } ).ToList(); } + private Panel GetParentPanel() + { + var parents = this.FindLogicalAncestorsAndSelf(); + + foreach( var parent in parents ) + { + var panel = parent as Panel; + if( panel != null && ( panel.Children[ 0 ] as TabItem ) != null ) + { + return panel; + } + } + return null; + } + private void StartDraggingFloatingWindowForContent() { this.ReleaseMouseCapture(); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs index 049a8fe5..e9ac0d80 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs @@ -233,11 +233,45 @@ namespace Xceed.Wpf.AvalonDock.Controls } } + if( this.WindowState == WindowState.Normal ) + { + this.UpdatePositionAndSizeOfPanes(); + } + base.OnStateChanged( e ); } #endregion + #region ResizeBorderThickness + + /// + /// ResizeBorderThickness Dependency Property + /// + public static readonly DependencyProperty ResizeBorderThicknessProperty = DependencyProperty.Register( + "ResizeBorderThickness", + typeof( Thickness ), + typeof( LayoutFloatingWindowControl ), + new FrameworkPropertyMetadata( new Thickness( 10 ) ) ); + + /// + /// Gets or sets the LayoutDocumentFloatingWindowControl/LayoutAnchorableFloatingWindowControl resize icon Border Thickness property. + /// This dependency property makes it possible to increase the resize icon border of floating windows. + /// + public Thickness ResizeBorderThickness + { + get + { + return ( Thickness )GetValue( ResizeBorderThicknessProperty ); + } + set + { + SetValue( ResizeBorderThicknessProperty, value ); + } + } + + #endregion + #endregion #region Overrides @@ -264,10 +298,13 @@ namespace Xceed.Wpf.AvalonDock.Controls protected override void OnClosed( EventArgs e ) { - var root = this.Model.Root; + var root = ( this.Model != null ) ? this.Model.Root : null; if( root != null ) { - root.Manager.RemoveFloatingWindow( this ); + if( root.Manager != null ) + { + root.Manager.RemoveFloatingWindow( this ); + } root.CollectGarbage(); } @@ -305,6 +342,34 @@ namespace Xceed.Wpf.AvalonDock.Controls base.OnInitialized( e ); } + protected override void OnKeyDown( KeyEventArgs e ) + { + var root = this.Model.Root; + if( root != null ) + { + if( root.Manager.AllowMovingFloatingWindowWithKeyboard ) + { + switch( e.Key ) + { + case Key.Left: + this.Left -= 25; + break; + case Key.Right: + this.Left += 25; + break; + case Key.Up: + this.Top -= 25; + break; + case Key.Down: + this.Top += 25; + break; + } + } + } + + base.OnKeyDown( e ); + } + protected override void OnPreviewKeyDown( KeyEventArgs e ) { if( Keyboard.IsKeyDown( Key.LeftCtrl ) || Keyboard.IsKeyDown( Key.RightCtrl ) ) @@ -499,7 +564,7 @@ namespace Xceed.Wpf.AvalonDock.Controls _isClosing = true; // Added Dispatcher to prevent InvalidOperationException issue in reference to bug case - // DevOps #2106 + // Azure case #2106 Dispatcher.BeginInvoke( new Action( () => { this.Close(); diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs index 2b7f1ccf..c0baf9bf 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs @@ -34,6 +34,8 @@ using Xceed.Wpf.AvalonDock.Themes; using System.Diagnostics; using System.Windows.Media; using System.Windows.Controls.Primitives; +using System.IO; +using System.Reflection; namespace Xceed.Wpf.AvalonDock { @@ -100,6 +102,32 @@ namespace Xceed.Wpf.AvalonDock + #region AllowMovingFloatingWindowWithKeyboard + + /// + /// AllowMovingFloatingWindowWithKeyboard Dependency Property + /// + public static readonly DependencyProperty AllowMovingFloatingWindowWithKeyboardProperty = DependencyProperty.Register( "AllowMovingFloatingWindowWithKeyboard", typeof( bool ), typeof( DockingManager ), + new FrameworkPropertyMetadata( ( bool )false ) ); + + /// + /// Gets/sets the AllowMovingFloatingWindowWithKeyboard property. This dependency property + /// indicates if the window can be moved with arrows keys. + /// + public bool AllowMovingFloatingWindowWithKeyboard + { + get + { + return ( bool )GetValue( AllowMovingFloatingWindowWithKeyboardProperty ); + } + private set + { + SetValue( AllowMovingFloatingWindowWithKeyboardProperty, value ); + } + } + + #endregion + #region Layout /// @@ -2098,8 +2126,12 @@ namespace Xceed.Wpf.AvalonDock }; newFW.SetParentToMainWindowOf( this ); - var mainWindow = Window.GetWindow( this ); - newFW.InputBindings.AddRange( mainWindow.InputBindings ); + var parent = this.Parent as FrameworkElement; + while( parent != null ) + { + newFW.InputBindings.AddRange( parent.InputBindings ); + parent = parent.Parent as FrameworkElement; + } var paneForExtensions = modelFW.RootPanel.Descendents().OfType().FirstOrDefault(); if( paneForExtensions != null ) @@ -2143,6 +2175,13 @@ namespace Xceed.Wpf.AvalonDock }; newFW.SetParentToMainWindowOf( this ); + var parent = this.Parent as FrameworkElement; + while( parent != null ) + { + newFW.InputBindings.AddRange( parent.InputBindings ); + parent = parent.Parent as FrameworkElement; + } + var paneForExtensions = modelFW.RootDocument; if( paneForExtensions != null ) { @@ -2438,7 +2477,7 @@ namespace Xceed.Wpf.AvalonDock #if VS2008 this.ActiveContent = ( Layout.ActiveContent != null ) ? Layout.ActiveContent.Content : null; #else - this.SetCurrentValue( DockingManager.ActiveContentProperty, ( Layout.ActiveContent != null ) ? Layout.ActiveContent.Content : null ); + this.SetCurrentValue( DockingManager.ActiveContentProperty, ( Layout.ActiveContent != null ) ? Layout.ActiveContent : null ); #endif } } @@ -2866,7 +2905,6 @@ namespace Xceed.Wpf.AvalonDock CreateAnchorableLayoutItem( anchorableToImport ); - } _suspendLayoutItemCreation = false; @@ -3043,11 +3081,26 @@ namespace Xceed.Wpf.AvalonDock } } - private void InternalSetActiveContent( object contentObject ) + private void InternalSetActiveContent( object activeContent ) { - var layoutContent = Layout.Descendents().OfType().FirstOrDefault( lc => lc == contentObject || lc.Content == contentObject ); + var activeLayoutContent = activeContent as LayoutContent; + var layoutContent = this.Layout.Descendents().OfType().FirstOrDefault( lc => + { + if( activeLayoutContent != null ) + { + if( activeLayoutContent.Content != null ) + return ( ( lc == activeLayoutContent.Content ) || ( lc.Content == activeLayoutContent.Content ) ); + + if( activeLayoutContent.ContentId != null ) + return ( lc.ContentId == activeLayoutContent.ContentId ); + } + else + return ( ( lc == activeContent ) || ( lc.Content == activeContent ) ); + + return ( ( lc == null ) || ( lc.Content == null ) ); + } ); _insideInternalSetActiveContent = true; - Layout.ActiveContent = layoutContent; + this.Layout.ActiveContent = layoutContent; _insideInternalSetActiveContent = false; } @@ -3207,6 +3260,9 @@ namespace Xceed.Wpf.AvalonDock private LayoutFloatingWindowControl CreateFloatingWindowForLayoutAnchorableWithoutParent( LayoutAnchorablePane paneModel, bool isContentImmutable ) { + var selectedlayoutContent = paneModel.SelectedContent; + this.RaisePreviewFloatEvent( selectedlayoutContent ); + if( paneModel.Children.Any( c => !c.CanFloat ) ) return null; var paneAsPositionableElement = paneModel as ILayoutPositionableElement; @@ -3282,20 +3338,24 @@ namespace Xceed.Wpf.AvalonDock Left = fwLeft }; - var mainWindow = Window.GetWindow( this ); - fwc.InputBindings.AddRange( mainWindow.InputBindings ); + this.ShowInTaskbar( fwc ); + + var parent = this.Parent as FrameworkElement; + while( parent != null ) + { + fwc.InputBindings.AddRange( parent.InputBindings ); + parent = parent.Parent as FrameworkElement; + } foreach( var layoutContent in destPane.Children ) { layoutContent.IsFloating = true; } - //fwc.Owner = Window.GetWindow(this); - //fwc.SetParentToMainWindowOf(this); - - _fwList.Add( fwc ); + this.RaiseFloatedEvent( selectedlayoutContent ); + Layout.CollectGarbage(); InvalidateArrange(); @@ -3305,11 +3365,13 @@ namespace Xceed.Wpf.AvalonDock private LayoutFloatingWindowControl CreateFloatingWindowCore( LayoutContent contentModel, bool isContentImmutable ) { + this.RaisePreviewFloatEvent( contentModel ); + if( !contentModel.CanFloat ) return null; + var contentModelAsAnchorable = contentModel as LayoutAnchorable; - if( contentModelAsAnchorable != null && - contentModelAsAnchorable.IsAutoHidden ) + if( contentModelAsAnchorable != null && contentModelAsAnchorable.IsAutoHidden ) contentModelAsAnchorable.ToggleAutoHide(); this.UpdateStarSize( contentModel ); @@ -3319,6 +3381,7 @@ namespace Xceed.Wpf.AvalonDock var parentPaneAsWithActualSize = contentModel.Parent as ILayoutPositionableElementWithActualSize; var contentModelParentChildrenIndex = parentPane.Children.ToList().IndexOf( contentModel ); + if( contentModel.FindParent() == null ) { ( ( ILayoutPreviousContainer )contentModel ).PreviousContainer = parentPane; @@ -3407,18 +3470,23 @@ namespace Xceed.Wpf.AvalonDock Left = contentModel.FloatingLeft, Top = contentModel.FloatingTop }; + } + this.ShowInTaskbar( fwc ); contentModel.IsFloating = true; - //fwc.Owner = Window.GetWindow(this); - //fwc.SetParentToMainWindowOf(this); - - var mainWindow = Window.GetWindow( this ); - fwc.InputBindings.AddRange( mainWindow.InputBindings ); + var parent = this.Parent as FrameworkElement; + while( parent != null ) + { + fwc.InputBindings.AddRange( parent.InputBindings ); + parent = parent.Parent as FrameworkElement; + } _fwList.Add( fwc ); + this.RaiseFloatedEvent( contentModel ); + Layout.CollectGarbage(); UpdateLayout(); @@ -3426,6 +3494,42 @@ namespace Xceed.Wpf.AvalonDock return fwc; } + private void ShowInTaskbar( LayoutFloatingWindowControl fwc ) + { + var layouts = fwc.Model.Descendents().OfType().Where( l => l != null ); + + if( layouts != null ) + { + fwc.ShowInTaskbar = true; + if( layouts.Count() > 1 ) + { + var selectedLayout = layouts.FirstOrDefault( l => l.IsSelected ); + fwc.Title = ( selectedLayout != null ) ? selectedLayout.Title : ""; + } + else + { + fwc.Title = layouts.ElementAt( 0 ).Title ?? ""; + } + } + + RenameWindowTitleForMultipleDockingManagerRunningInstances( fwc ); + } + + private void RenameWindowTitleForMultipleDockingManagerRunningInstances( LayoutFloatingWindowControl fwc ) + { + // Check if others applications run DockingManager + var exists = Process.GetProcessesByName( Path.GetFileNameWithoutExtension( Assembly.GetEntryAssembly().Location ) ).Count() > 1; + + if( exists ) + { + var mainWindowTitle = Window.GetWindow( this ).Title; + if( !string.IsNullOrEmpty( mainWindowTitle ) ) + { + fwc.Title = mainWindowTitle + " - " + fwc.Title; + } + } + } + private Size UpdateFloatingDimensions( ILayoutElementForFloatingWindow contentModel, Size currentSize ) { if( contentModel.FloatingWidth != 0d ) @@ -3644,6 +3748,87 @@ namespace Xceed.Wpf.AvalonDock return _areas; } + public static readonly RoutedEvent PreviewFloatEvent = EventManager.RegisterRoutedEvent( "PreviewFloat", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( DockingManager ) ); + + public event RoutedEventHandler PreviewFloat + { + add + { + AddHandler( PreviewFloatEvent, value ); + } + remove + { + RemoveHandler( PreviewFloatEvent, value ); + } + } + + protected virtual void RaisePreviewFloatEvent( LayoutContent layoutContent ) + { + var args = new RoutedEventArgs( DockingManager.PreviewFloatEvent, layoutContent ); + RaiseEvent( args ); + } + + public static readonly RoutedEvent FloatedEvent = EventManager.RegisterRoutedEvent( "Floated", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( DockingManager ) ); + + public event RoutedEventHandler Floated + { + add + { + AddHandler( FloatedEvent, value ); + } + remove + { + RemoveHandler( FloatedEvent, value ); + } + } + + protected virtual void RaiseFloatedEvent( LayoutContent layoutContent ) + { + var args = new RoutedEventArgs( DockingManager.FloatedEvent, layoutContent ); + RaiseEvent( args ); + } + + + public static readonly RoutedEvent PreviewDockEvent = EventManager.RegisterRoutedEvent( "PreviewDock", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( DockingManager ) ); + + public event RoutedEventHandler PreviewDock + { + add + { + AddHandler( PreviewDockEvent, value ); + } + remove + { + RemoveHandler( PreviewDockEvent, value ); + } + } + + protected internal virtual void RaisePreviewDockEvent( LayoutContent layoutContent ) + { + var args = new RoutedEventArgs( DockingManager.PreviewDockEvent, layoutContent ); + RaiseEvent( args ); + } + + public static readonly RoutedEvent DockedEvent = EventManager.RegisterRoutedEvent( "Docked", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( DockingManager ) ); + + public event RoutedEventHandler Docked + { + add + { + AddHandler( DockedEvent, value ); + } + remove + { + RemoveHandler( DockedEvent, value ); + } + } + + protected internal virtual void RaiseDockedEvent( LayoutContent layoutContent ) + { + var args = new RoutedEventArgs( DockingManager.DockedEvent, layoutContent ); + RaiseEvent( args ); + } + #endregion #region IWeakEventListener @@ -3676,5 +3861,10 @@ namespace Xceed.Wpf.AvalonDock } #endregion + } + + } + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs index eb6aed2b..87f4769d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutAnchorable.cs @@ -280,37 +280,42 @@ namespace Xceed.Wpf.AvalonDock.Layout protected override void InternalDock() { var root = Root as LayoutRoot; - LayoutAnchorablePane anchorablePane = null; + ILayoutPane layoutPane = null; if( root.ActiveContent != null && root.ActiveContent != this ) { //look for active content parent pane - anchorablePane = root.ActiveContent.Parent as LayoutAnchorablePane; + layoutPane = root.ActiveContent.Parent as LayoutAnchorablePane; } - if( anchorablePane == null ) + if( layoutPane == null ) { //look for a pane on the right side - anchorablePane = root.Descendents().OfType().Where( pane => !pane.IsHostedInFloatingWindow && pane.GetSide() == AnchorSide.Right ).FirstOrDefault(); + layoutPane = root.Descendents().OfType().Where( pane => !pane.IsHostedInFloatingWindow && pane.GetSide() == AnchorSide.Right ).FirstOrDefault(); } - if( anchorablePane == null ) + if( layoutPane == null ) { //look for an available pane - anchorablePane = root.Descendents().OfType().FirstOrDefault(); + layoutPane = root.Descendents().OfType().Where( pane => !pane.IsHostedInFloatingWindow ).FirstOrDefault(); } + if( layoutPane == null ) + { + //look for an available pane + layoutPane = root.Descendents().OfType().FirstOrDefault(); + } bool added = false; if( root.Manager.LayoutUpdateStrategy != null ) { - added = root.Manager.LayoutUpdateStrategy.BeforeInsertAnchorable( root, this, anchorablePane ); + added = root.Manager.LayoutUpdateStrategy.BeforeInsertAnchorable( root, this, layoutPane ); } if( !added ) { - if( anchorablePane == null ) + if( layoutPane == null ) { var mainLayoutPanel = new LayoutPanel() { Orientation = Orientation.Horizontal }; if( root.RootPanel != null ) @@ -319,11 +324,19 @@ namespace Xceed.Wpf.AvalonDock.Layout } root.RootPanel = mainLayoutPanel; - anchorablePane = new LayoutAnchorablePane() { DockWidth = new GridLength( 200.0, GridUnitType.Pixel ) }; - mainLayoutPanel.Children.Add( anchorablePane ); + layoutPane = new LayoutAnchorablePane() { DockWidth = new GridLength( 200.0, GridUnitType.Pixel ) }; + mainLayoutPanel.Children.Add( ( ILayoutPanelElement )layoutPane ); + } + + if( layoutPane is LayoutAnchorablePane ) + { + ( layoutPane as LayoutAnchorablePane ).Children.Add( this ); + } + else + { + ( layoutPane as LayoutDocumentPane ).Children.Add( this ); } - anchorablePane.Children.Add( this ); added = true; } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs index 6d13ad0e..d62a0d49 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs @@ -20,6 +20,7 @@ using System.ComponentModel; using System.Globalization; using System.Linq; using System.Windows; +using System.Windows.Controls; using System.Windows.Markup; using System.Windows.Media; using System.Xml.Serialization; @@ -170,6 +171,8 @@ namespace Xceed.Wpf.AvalonDock.Layout /// protected virtual void OnIsSelectedChanged( bool oldValue, bool newValue ) { + this.UpdateContainedFloatingWindowTaskbarTitle( newValue ); + if( IsSelectedChanged != null ) IsSelectedChanged( this, EventArgs.Empty ); } @@ -921,9 +924,25 @@ namespace Xceed.Wpf.AvalonDock.Layout if( newParentPane != null ) { newParentPane.Children.Add( this ); - root.CollectGarbage(); } + else + { + var mainLayoutPanel = new LayoutPanel() { Orientation = Orientation.Horizontal }; + if( root.RootPanel != null ) + { + mainLayoutPanel.Children.Add( root.RootPanel ); + } + + root.RootPanel = mainLayoutPanel; + newParentPane = new LayoutDocumentPane() { }; + mainLayoutPanel.Children.Add( ( ILayoutPanelElement )newParentPane ); + + newParentPane.Children.Add( this ); + } + + root.CollectGarbage(); + IsFloating = false; IsSelected = true; IsActive = true; } @@ -1026,6 +1045,39 @@ namespace Xceed.Wpf.AvalonDock.Layout #endregion + #region Private Methods + + private void UpdateContainedFloatingWindowTaskbarTitle( bool newValue ) + { + if( !newValue ) // LayoutContent is being deselected + { + // Check if LayoutContent is inside a FloatingWindowControl + // And set the correct title for Taskbar Title + var root = Root; + + if( root != null ) + { + var lfwc = root.Manager.FloatingWindows; + var containedFloatingWindowControl = lfwc.FirstOrDefault( f => f.Model.Descendents().OfType().Where( l => l.ContentId == this.ContentId ).FirstOrDefault() != null ); + + if( containedFloatingWindowControl != null ) + { + var selectedLayoutContent = containedFloatingWindowControl.Model.Descendents().OfType().Where( l => l.IsSelected ).FirstOrDefault(); + + if( selectedLayoutContent != null ) + { + if( containedFloatingWindowControl.Title != selectedLayoutContent.Title ) + { + containedFloatingWindowControl.Title = selectedLayoutContent.Title; + } + } + } + } + } + } + + #endregion // Private Methods + #region Events /// diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml index 8de02e25..c7fbf08d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml @@ -1006,7 +1006,7 @@ Value="3" /> - - diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs index 4be77d2c..86f8801d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs @@ -49,7 +49,7 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion( "4.4" )] +[assembly: AssemblyVersion( "4.5" )] #pragma warning disable 1699 [assembly: AssemblyDelaySign( false )] diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ExtTabControl/Views/ExtTabControlView.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ExtTabControl/Views/ExtTabControlView.xaml index 0efc30d1..9bf1979a 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ExtTabControl/Views/ExtTabControlView.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/ExtTabControl/Views/ExtTabControlView.xaml @@ -51,6 +51,10 @@ + + + + diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs index e544904e..22431580 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs @@ -22,7 +22,7 @@ internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] - public const string BaseVersion = "4.4"; + public const string BaseVersion = "4.5"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CheckComboBox/Themes/Aero2.NormalColor.xaml b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CheckComboBox/Themes/Aero2.NormalColor.xaml index a1c25151..68ba0ca8 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CheckComboBox/Themes/Aero2.NormalColor.xaml +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CheckComboBox/Themes/Aero2.NormalColor.xaml @@ -26,6 +26,7 @@ + M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z - + - + + + + + + +