Skip to content

Commit 59dd599

Browse files
committed
V4.0.2 Released
1 parent da2776d commit 59dd599

File tree

94 files changed

+2354
-1584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2354
-1584
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
CornerRadius="2">
132132
<ContentPresenter x:Name="PART_SelectedContentHost"
133133
ContentSource="SelectedContent"
134-
ContentTemplate="{TemplateBinding ContentTemplate}"
135134
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
136135
</Border>
137136
</Border>
@@ -324,7 +323,6 @@
324323
KeyboardNavigation.TabNavigation="Cycle">
325324
<ContentPresenter x:Name="PART_SelectedContentHost"
326325
ContentSource="SelectedContent"
327-
ContentTemplate="{TemplateBinding ContentTemplate}"
328326
Margin="{TemplateBinding Padding}"
329327
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
330328
</Border>
@@ -509,7 +507,7 @@
509507
HorizontalAlignment="Center"
510508
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
511509
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
512-
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
510+
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
513511
<Image x:Name="PART_ImgHidePin"
514512
Source="Images/PinClose_Dark.png" >
515513
</Image>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
Padding="0,1,0,2">
164164
<ContentPresenter x:Name="PART_SelectedContentHost"
165165
ContentSource="SelectedContent"
166-
ContentTemplate="{TemplateBinding ContentTemplate}"
167166
Margin="0,2,0,2"
168167
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
169168
</Border>
@@ -334,7 +333,6 @@
334333
KeyboardNavigation.TabNavigation="Cycle">
335334
<ContentPresenter x:Name="PART_SelectedContentHost"
336335
ContentSource="SelectedContent"
337-
ContentTemplate="{TemplateBinding ContentTemplate}"
338336
Margin="{TemplateBinding Padding}"
339337
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
340338
</Border>
@@ -518,7 +516,7 @@
518516
HorizontalAlignment="Center"
519517
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
520518
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
521-
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
519+
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
522520
<Image x:Name="PART_ImgHidePin"
523521
Source="Images/PinClose.png" >
524522
</Image>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
Padding="0,1,0,2">
197197
<ContentPresenter x:Name="PART_SelectedContentHost"
198198
ContentSource="SelectedContent"
199-
ContentTemplate="{TemplateBinding ContentTemplate}"
200199
Margin="0,2,0,2"
201200
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
202201
</Border>
@@ -417,7 +416,6 @@
417416
KeyboardNavigation.TabNavigation="Cycle">
418417
<ContentPresenter x:Name="PART_SelectedContentHost"
419418
ContentSource="SelectedContent"
420-
ContentTemplate="{TemplateBinding ContentTemplate}"
421419
Margin="{TemplateBinding Padding}"
422420
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
423421
</Border>
@@ -605,7 +603,7 @@
605603
HorizontalAlignment="Center"
606604
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
607605
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
608-
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
606+
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
609607
<Image x:Name="PART_ImgHidePin"
610608
Source="Images/PinClose.png" >
611609
</Image>

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

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
6161
#region DropTargetType.DocumentPaneDockBottom
6262
{
6363
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
64+
var targetPane = targetModel as ILayoutPositionableElement;
65+
if( targetPane != null )
66+
{
67+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
68+
if( targetPane.DockHeight.IsStar )
69+
{
70+
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
71+
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
72+
}
73+
}
6474
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
6575

6676
if( parentModel == null )
@@ -97,6 +107,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
97107
#region DropTargetType.DocumentPaneDockTop
98108
{
99109
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
110+
var targetPane = targetModel as ILayoutPositionableElement;
111+
if( targetPane != null )
112+
{
113+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
114+
if( targetPane.DockHeight.IsStar )
115+
{
116+
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
117+
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
118+
}
119+
}
100120
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
101121

102122
if( parentModel == null )
@@ -133,6 +153,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
133153
#region DropTargetType.DocumentPaneDockLeft
134154
{
135155
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
156+
var targetPane = targetModel as ILayoutPositionableElement;
157+
if( targetPane != null )
158+
{
159+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
160+
if( targetPane.DockWidth.IsStar )
161+
{
162+
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
163+
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
164+
}
165+
}
136166
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
137167

138168
if( parentModel == null )
@@ -168,6 +198,16 @@ protected override void Drop( LayoutDocumentFloatingWindow floatingWindow )
168198
#region DropTargetType.DocumentPaneDockRight
169199
{
170200
var newLayoutDocumentPane = new LayoutDocumentPane( floatingWindow.RootDocument );
201+
var targetPane = targetModel as ILayoutPositionableElement;
202+
if( targetPane != null )
203+
{
204+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
205+
if( targetPane.DockWidth.IsStar )
206+
{
207+
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
208+
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
209+
}
210+
}
171211
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
172212

173213
if( parentModel == null )
@@ -247,6 +287,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
247287
{
248288
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
249289
var newLayoutDocumentPane = new LayoutDocumentPane();
290+
var targetPane = targetModel as ILayoutPositionableElement;
291+
if( targetPane != null )
292+
{
293+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
294+
if( targetPane.DockHeight.IsStar )
295+
{
296+
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
297+
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
298+
}
299+
}
250300

251301
if( parentModel == null )
252302
{
@@ -286,6 +336,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
286336
{
287337
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
288338
var newLayoutDocumentPane = new LayoutDocumentPane();
339+
var targetPane = targetModel as ILayoutPositionableElement;
340+
if( targetPane != null )
341+
{
342+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
343+
if( targetPane.DockHeight.IsStar )
344+
{
345+
targetPane.DockHeight = new GridLength( targetPane.DockHeight.Value / 2d, GridUnitType.Star );
346+
newLayoutDocumentPane.DockHeight = targetPane.DockHeight;
347+
}
348+
}
289349

290350
if( parentModel == null )
291351
{
@@ -325,6 +385,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
325385
{
326386
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
327387
var newLayoutDocumentPane = new LayoutDocumentPane();
388+
var targetPane = targetModel as ILayoutPositionableElement;
389+
if( targetPane != null )
390+
{
391+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
392+
if( targetPane.DockWidth.IsStar )
393+
{
394+
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
395+
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
396+
}
397+
}
328398

329399
if( parentModel == null )
330400
{
@@ -365,6 +435,16 @@ protected override void Drop( LayoutAnchorableFloatingWindow floatingWindow )
365435
{
366436
var parentModel = targetModel.Parent as LayoutDocumentPaneGroup;
367437
var newLayoutDocumentPane = new LayoutDocumentPane();
438+
var targetPane = targetModel as ILayoutPositionableElement;
439+
if( targetPane != null )
440+
{
441+
// Set the DockWidth of the targetPane and the newLayoutDocumentPane so they both use the same size.
442+
if( targetPane.DockWidth.IsStar )
443+
{
444+
targetPane.DockWidth = new GridLength( targetPane.DockWidth.Value / 2d, GridUnitType.Star );
445+
newLayoutDocumentPane.DockWidth = targetPane.DockWidth;
446+
}
447+
}
368448

369449
if( parentModel == null )
370450
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ private void OnExecuteHideWindowCommand( object parameter )
347347
var anchorableLayoutItem = manager.GetLayoutItemFromModel( anchorable ) as LayoutAnchorableItem;
348348
anchorableLayoutItem.HideCommand.Execute( parameter );
349349
}
350+
351+
this.BringFocusOnDockingManager();
350352
}
351353
#endregion
352354

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonE
8282
{
8383
base.OnMouseLeftButtonDown( e );
8484

85-
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
86-
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
87-
&& this.Model.Root.Manager.Equals(parentDockingManager))
85+
if( e.OriginalSource is Visual )
8886
{
89-
if (!e.Handled && (_model != null) && (_model.SelectedContent != null) )
87+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
88+
89+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
90+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
9091
{
91-
_model.SelectedContent.IsActive = true;
92+
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
93+
{
94+
_model.SelectedContent.IsActive = true;
95+
}
9296
}
9397
}
9498
}
@@ -97,15 +101,19 @@ protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButton
97101
{
98102
base.OnMouseRightButtonDown( e );
99103

100-
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
101-
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
102-
&& this.Model.Root.Manager.Equals(parentDockingManager))
104+
if( e.OriginalSource is Visual )
103105
{
104-
if (!e.Handled && (_model != null) && (_model.SelectedContent != null))
106+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
107+
108+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
109+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
105110
{
106-
_model.SelectedContent.IsActive = true;
111+
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
112+
{
113+
_model.SelectedContent.IsActive = true;
114+
}
107115
}
108-
}
116+
}
109117
}
110118

111119

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1616
***********************************************************************************/
1717

1818

19+
using System.Collections.Generic;
1920
using System.Windows;
2021
using System.Windows.Controls;
2122
using System.Windows.Data;
23+
using System.Linq;
2224
using Xceed.Wpf.AvalonDock.Layout;
2325

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

9799

98100

99-
100101

101102

102103
}

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,33 @@ protected override void OnPreviewGotKeyboardFocus( KeyboardFocusChangedEventArgs
163163

164164
protected override void OnPreviewMouseLeftButtonDown( MouseButtonEventArgs e )
165165
{
166-
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
167-
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
168-
&& this.Model.Root.Manager.Equals(parentDockingManager))
166+
if( e.OriginalSource is Visual )
169167
{
170-
this.SetIsActive();
168+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
169+
170+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
171+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
172+
{
173+
this.SetIsActive();
174+
}
171175
}
176+
172177
base.OnPreviewMouseLeftButtonDown( e );
173178
}
174179

175180
protected override void OnPreviewMouseRightButtonDown( MouseButtonEventArgs e )
176181
{
177-
var parentDockingManager = ((Visual)e.OriginalSource).FindVisualAncestor<DockingManager>();
178-
if ((this.Model != null) && (this.Model.Root != null) && (this.Model.Root.Manager != null)
179-
&& this.Model.Root.Manager.Equals(parentDockingManager))
182+
if( e.OriginalSource is Visual )
180183
{
181-
this.SetIsActive();
184+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
185+
186+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
187+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
188+
{
189+
this.SetIsActive();
190+
}
182191
}
192+
183193
base.OnPreviewMouseRightButtonDown( e );
184194
}
185195

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public LayoutItem RootDocumentLayoutItem
5959
{
6060
get
6161
{
62+
if( ( _model == null ) || ( _model.Root == null ) || ( _model.Root.Manager == null ) )
63+
return null;
64+
6265
return _model.Root.Manager.GetLayoutItemFromModel( _model.RootDocument );
6366
}
6467
}

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

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,36 @@ protected override void OnMouseLeftButtonDown( System.Windows.Input.MouseButtonE
9393
{
9494
base.OnMouseLeftButtonDown( e );
9595

96-
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
97-
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
98-
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
96+
if( e.OriginalSource is Visual )
9997
{
100-
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
98+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
99+
100+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
101+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
101102
{
102-
_model.SelectedContent.IsActive = true;
103+
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
104+
{
105+
_model.SelectedContent.IsActive = true;
106+
}
103107
}
104-
}
108+
}
105109
}
106110

107111
protected override void OnMouseRightButtonDown( System.Windows.Input.MouseButtonEventArgs e )
108112
{
109113
base.OnMouseRightButtonDown( e );
110114

111-
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
112-
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
113-
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
115+
if( e.OriginalSource is Visual )
114116
{
115-
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
117+
var parentDockingManager = ( ( Visual )e.OriginalSource ).FindVisualAncestor<DockingManager>();
118+
119+
if( ( this.Model != null ) && ( this.Model.Root != null ) && ( this.Model.Root.Manager != null )
120+
&& this.Model.Root.Manager.Equals( parentDockingManager ) )
116121
{
117-
_model.SelectedContent.IsActive = true;
122+
if( !e.Handled && ( _model != null ) && ( _model.SelectedContent != null ) )
123+
{
124+
_model.SelectedContent.IsActive = true;
125+
}
118126
}
119127
}
120128
}

0 commit comments

Comments
 (0)