Skip to content

Commit c110ea7

Browse files
committed
V4.5.0 Released
1 parent ff6ba4a commit c110ea7

File tree

33 files changed

+756
-87
lines changed

33 files changed

+756
-87
lines changed
Binary file not shown.
Binary file not shown.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,10 +1314,10 @@
13141314
<Setter Property="BorderBrush"
13151315
Value="{DynamicResource {x:Static avalonDockAero:AeroColors.BaseColor14Key}}" />
13161316
<Setter Property="BorderThickness"
1317-
Value="1" />
1317+
Value="3" />
13181318
<Setter Property="shell:WindowChrome.WindowChrome">
13191319
<Setter.Value>
1320-
<shell:WindowChrome ResizeBorderThickness="10"
1320+
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
13211321
CaptionHeight="18"
13221322
CornerRadius="3"
13231323
GlassFrameThickness="0"
@@ -1491,10 +1491,10 @@
14911491
<Setter Property="BorderBrush"
14921492
Value="{DynamicResource {x:Static avalonDockAero:AeroColors.BaseColor16Key}}" />
14931493
<Setter Property="BorderThickness"
1494-
Value="4" />
1494+
Value="3" />
14951495
<Setter Property="shell:WindowChrome.WindowChrome">
14961496
<Setter.Value>
1497-
<shell:WindowChrome ResizeBorderThickness="10"
1497+
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
14981498
CaptionHeight="18"
14991499
CornerRadius="7"
15001500
GlassFrameThickness="0" />

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,11 +1357,11 @@
13571357
<Setter Property="BorderBrush"
13581358
Value="{DynamicResource AvalonDock_ThemeMetro_BaseColor6}" />
13591359
<Setter Property="BorderThickness"
1360-
Value="1" />
1360+
Value="3" />
13611361
<Setter Property="shell:WindowChrome.WindowChrome">
13621362
<Setter.Value>
13631363
<shell:WindowChrome CornerRadius="0"
1364-
ResizeBorderThickness="10"
1364+
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
13651365
CaptionHeight="24"
13661366
GlassFrameThickness="0"
13671367
ShowSystemMenu="False" />
@@ -1548,11 +1548,11 @@
15481548
<Setter Property="BorderBrush"
15491549
Value="{DynamicResource AvalonDock_ThemeMetro_BaseColor6}" />
15501550
<Setter Property="BorderThickness"
1551-
Value="1" />
1551+
Value="3" />
15521552
<Setter Property="shell:WindowChrome.WindowChrome">
15531553
<Setter.Value>
15541554
<shell:WindowChrome CornerRadius="0"
1555-
ResizeBorderThickness="10"
1555+
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
15561556
CaptionHeight="24"
15571557
GlassFrameThickness="0" />
15581558
</Setter.Value>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,10 @@
14561456
<Setter Property="BorderBrush"
14571457
Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor33}" />
14581458
<Setter Property="BorderThickness"
1459-
Value="1" />
1459+
Value="3" />
14601460
<Setter Property="shell:WindowChrome.WindowChrome">
14611461
<Setter.Value>
1462-
<shell:WindowChrome ResizeBorderThickness="10"
1462+
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
14631463
CaptionHeight="18"
14641464
CornerRadius="3"
14651465
GlassFrameThickness="0"
@@ -1683,10 +1683,10 @@
16831683
<Setter Property="BorderBrush"
16841684
Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor16}" />
16851685
<Setter Property="BorderThickness"
1686-
Value="4" />
1686+
Value="3" />
16871687
<Setter Property="shell:WindowChrome.WindowChrome">
16881688
<Setter.Value>
1689-
<shell:WindowChrome ResizeBorderThickness="10"
1689+
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
16901690
CaptionHeight="18"
16911691
CornerRadius="7"
16921692
GlassFrameThickness="0" />

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,32 @@ public void Drop( LayoutFloatingWindow floatingWindow )
9999
{
100100
var root = floatingWindow.Root;
101101
var currentActiveContent = floatingWindow.Root.ActiveContent;
102+
var manager = root.Manager;
102103
var fwAsAnchorable = floatingWindow as LayoutAnchorableFloatingWindow;
103104

104105
if( fwAsAnchorable != null )
105106
{
107+
// Raise PreviewDock Event
108+
var draggedLayoutAnchorable = floatingWindow.Descendents().OfType<LayoutAnchorable>().FirstOrDefault( l => l != null );
109+
manager.RaisePreviewDockEvent( draggedLayoutAnchorable );
110+
106111
this.Drop( fwAsAnchorable );
112+
113+
// Raise Dock Event
114+
manager.RaiseDockedEvent( draggedLayoutAnchorable );
107115
}
108116
else
109117
{
110118
var fwAsDocument = floatingWindow as LayoutDocumentFloatingWindow;
119+
120+
// Raise PreviewDock Event
121+
var draggedLayoutDocument = floatingWindow.Descendents().OfType<LayoutDocument>().FirstOrDefault( l => l != null );
122+
manager.RaisePreviewDockEvent( draggedLayoutDocument );
123+
111124
this.Drop( fwAsDocument );
125+
126+
// Raise Dock Event
127+
manager.RaiseDockedEvent( draggedLayoutDocument );
112128
}
113129

114130
if( currentActiveContent != null )

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,14 @@ public static T FindLogicalAncestor<T>( this DependencyObject dependencyObject )
113113
while( target != null && !( target is T ) );
114114
return target as T;
115115
}
116+
117+
public static IEnumerable<DependencyObject> FindLogicalAncestorsAndSelf( this DependencyObject self )
118+
{
119+
while( self != null )
120+
{
121+
yield return self;
122+
self = LogicalTreeHelper.GetParent( self ) ?? VisualTreeHelper.GetParent( self );
123+
}
124+
}
116125
}
117126
}

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class LayoutDocumentTabItem : Control
3535
private List<Rect> _otherTabsScreenArea = null;
3636
private List<TabItem> _otherTabs = null;
3737
private Rect _parentDocumentTabPanelScreenArea;
38-
private DocumentPaneTabPanel _parentDocumentTabPanel;
38+
private Panel _parentTabPanel;
3939
private bool _isMouseDown = false;
4040
private Point _mouseDownPoint;
4141
private double _mouseLastChangePositionX;
@@ -220,7 +220,7 @@ protected override void OnMouseMove( System.Windows.Input.MouseEventArgs e )
220220
containerPane.MoveChild( currentIndex, newIndex );
221221
_dragBuffer = MaxDragBuffer;
222222
this.Model.IsActive = true;
223-
_parentDocumentTabPanel.UpdateLayout();
223+
_parentTabPanel.UpdateLayout();
224224
this.UpdateDragDetails();
225225
_mouseLastChangePositionX = mousePosInScreenCoord.X;
226226
}
@@ -271,10 +271,19 @@ protected override void OnMouseDown( MouseButtonEventArgs e )
271271

272272
private void UpdateDragDetails()
273273
{
274-
_parentDocumentTabPanel = this.FindLogicalAncestor<DocumentPaneTabPanel>();
275-
_parentDocumentTabPanelScreenArea = _parentDocumentTabPanel.GetScreenArea();
274+
_parentTabPanel = this.FindLogicalAncestor<DocumentPaneTabPanel>();
275+
276+
if( _parentTabPanel == null )
277+
{
278+
_parentTabPanel = this.GetParentPanel();
279+
}
280+
281+
if( _parentTabPanel == null )
282+
return;
283+
284+
_parentDocumentTabPanelScreenArea = _parentTabPanel.GetScreenArea();
276285
_parentDocumentTabPanelScreenArea.Inflate( 0, _dragBuffer );
277-
_otherTabs = _parentDocumentTabPanel.Children.Cast<TabItem>().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList();
286+
_otherTabs = _parentTabPanel.Children.Cast<TabItem>().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList();
278287
var currentTabScreenArea = this.FindLogicalAncestor<TabItem>().GetScreenArea();
279288
_otherTabsScreenArea = _otherTabs.Select( ti =>
280289
{
@@ -285,6 +294,21 @@ private void UpdateDragDetails()
285294
} ).ToList();
286295
}
287296

297+
private Panel GetParentPanel()
298+
{
299+
var parents = this.FindLogicalAncestorsAndSelf();
300+
301+
foreach( var parent in parents )
302+
{
303+
var panel = parent as Panel;
304+
if( panel != null && ( panel.Children[ 0 ] as TabItem ) != null )
305+
{
306+
return panel;
307+
}
308+
}
309+
return null;
310+
}
311+
288312
private void StartDraggingFloatingWindowForContent()
289313
{
290314
this.ReleaseMouseCapture();

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

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,45 @@ protected override void OnStateChanged( EventArgs e )
233233
}
234234
}
235235

236+
if( this.WindowState == WindowState.Normal )
237+
{
238+
this.UpdatePositionAndSizeOfPanes();
239+
}
240+
236241
base.OnStateChanged( e );
237242
}
238243

239244
#endregion
240245

246+
#region ResizeBorderThickness
247+
248+
/// <summary>
249+
/// ResizeBorderThickness Dependency Property
250+
/// </summary>
251+
public static readonly DependencyProperty ResizeBorderThicknessProperty = DependencyProperty.Register(
252+
"ResizeBorderThickness",
253+
typeof( Thickness ),
254+
typeof( LayoutFloatingWindowControl ),
255+
new FrameworkPropertyMetadata( new Thickness( 10 ) ) );
256+
257+
/// <summary>
258+
/// Gets or sets the LayoutDocumentFloatingWindowControl/LayoutAnchorableFloatingWindowControl resize icon Border Thickness property.
259+
/// This dependency property makes it possible to increase the resize icon border of floating windows.
260+
/// </summary>
261+
public Thickness ResizeBorderThickness
262+
{
263+
get
264+
{
265+
return ( Thickness )GetValue( ResizeBorderThicknessProperty );
266+
}
267+
set
268+
{
269+
SetValue( ResizeBorderThicknessProperty, value );
270+
}
271+
}
272+
273+
#endregion
274+
241275
#endregion
242276

243277
#region Overrides
@@ -264,10 +298,13 @@ protected override void OnClosing( System.ComponentModel.CancelEventArgs e )
264298

265299
protected override void OnClosed( EventArgs e )
266300
{
267-
var root = this.Model.Root;
301+
var root = ( this.Model != null ) ? this.Model.Root : null;
268302
if( root != null )
269303
{
270-
root.Manager.RemoveFloatingWindow( this );
304+
if( root.Manager != null )
305+
{
306+
root.Manager.RemoveFloatingWindow( this );
307+
}
271308
root.CollectGarbage();
272309
}
273310

@@ -305,6 +342,34 @@ protected override void OnInitialized( EventArgs e )
305342
base.OnInitialized( e );
306343
}
307344

345+
protected override void OnKeyDown( KeyEventArgs e )
346+
{
347+
var root = this.Model.Root;
348+
if( root != null )
349+
{
350+
if( root.Manager.AllowMovingFloatingWindowWithKeyboard )
351+
{
352+
switch( e.Key )
353+
{
354+
case Key.Left:
355+
this.Left -= 25;
356+
break;
357+
case Key.Right:
358+
this.Left += 25;
359+
break;
360+
case Key.Up:
361+
this.Top -= 25;
362+
break;
363+
case Key.Down:
364+
this.Top += 25;
365+
break;
366+
}
367+
}
368+
}
369+
370+
base.OnKeyDown( e );
371+
}
372+
308373
protected override void OnPreviewKeyDown( KeyEventArgs e )
309374
{
310375
if( Keyboard.IsKeyDown( Key.LeftCtrl ) || Keyboard.IsKeyDown( Key.RightCtrl ) )
@@ -499,7 +564,7 @@ internal void InternalClose()
499564
_isClosing = true;
500565

501566
// Added Dispatcher to prevent InvalidOperationException issue in reference to bug case
502-
// DevOps #2106
567+
// Azure case #2106
503568
Dispatcher.BeginInvoke( new Action( () =>
504569
{
505570
this.Close();

0 commit comments

Comments
 (0)