Skip to content

Commit a20eb81

Browse files
committed
V4.3.0 Released
1 parent 64115ba commit a20eb81

File tree

102 files changed

+3606
-402
lines changed

Some content is hidden

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

102 files changed

+3606
-402
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
KeyboardNavigation.TabIndex="1"
8484
KeyboardNavigation.DirectionalNavigation="Cycle"/>
8585
<avalonDockControls:DropDownButton x:Name="MenuDropDownButton"
86-
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
86+
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
8787
Focusable="False"
8888
VerticalAlignment="Center"
8989
Grid.Column="1">
@@ -473,7 +473,7 @@
473473

474474
<avalonDockControls:DropDownButton x:Name="MenuDropDownButton"
475475
VerticalAlignment="Center"
476-
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
476+
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
477477
Focusable="False"
478478
Grid.Column="1"
479479
Padding="-1"
@@ -489,7 +489,7 @@
489489
Grid.Column="2"
490490
Focusable="False"
491491
Padding="-1"
492-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
492+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
493493
VerticalAlignment="Center"
494494
HorizontalAlignment="Center"
495495
Command="{Binding Path=LayoutItem.AutoHideCommand, RelativeSource={RelativeSource TemplatedParent}}"
@@ -503,7 +503,7 @@
503503
Grid.Column="3"
504504
Focusable="False"
505505
Padding="-1"
506-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
506+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
507507
VerticalAlignment="Center"
508508
HorizontalAlignment="Center"
509509
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
@@ -1181,7 +1181,7 @@
11811181
ContentTemplateSelector="{Binding Root.Manager.DocumentHeaderTemplateSelector, Mode=OneWay}" />
11821182
<!-- Close button should be moved out to the container style -->
11831183
<Button x:Name="DocumentCloseButton"
1184-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1184+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
11851185
VerticalAlignment="Center"
11861186
HorizontalAlignment="Center"
11871187
Grid.Column="2"
@@ -1355,7 +1355,7 @@
13551355

13561356
<avalonDockControls:DropDownButton x:Name="ContextMenuDropdownButton"
13571357
shell:WindowChrome.IsHitTestVisibleInChrome="True"
1358-
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
1358+
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
13591359
Focusable="False"
13601360
Grid.Column="1"
13611361
VerticalAlignment="Center"
@@ -1376,7 +1376,7 @@
13761376
shell:WindowChrome.IsHitTestVisibleInChrome="True"
13771377
Focusable="False"
13781378
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
1379-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1379+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
13801380
Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
13811381
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
13821382
ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
@@ -1391,7 +1391,7 @@
13911391
shell:WindowChrome.IsHitTestVisibleInChrome="True"
13921392
Focusable="False"
13931393
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
1394-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1394+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
13951395
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
13961396
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
13971397
ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
@@ -1405,7 +1405,7 @@
14051405
<Button x:Name="PART_PinClose"
14061406
shell:WindowChrome.IsHitTestVisibleInChrome="True"
14071407
Focusable="False"
1408-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1408+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
14091409
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
14101410
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
14111411
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
@@ -1539,7 +1539,7 @@
15391539
<avalonDockControls:DropDownButton x:Name="SinglePaneContextMenu"
15401540
shell:WindowChrome.IsHitTestVisibleInChrome="True"
15411541
Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
1542-
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
1542+
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
15431543
Focusable="False"
15441544
Grid.Column="1"
15451545
VerticalAlignment="Center"
@@ -1560,7 +1560,7 @@
15601560
shell:WindowChrome.IsHitTestVisibleInChrome="True"
15611561
Focusable="False"
15621562
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
1563-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1563+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
15641564
VerticalAlignment="Center"
15651565
HorizontalAlignment="Center"
15661566
VerticalContentAlignment="Center"
@@ -1579,7 +1579,7 @@
15791579
shell:WindowChrome.IsHitTestVisibleInChrome="True"
15801580
Focusable="False"
15811581
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
1582-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1582+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
15831583
VerticalAlignment="Center"
15841584
HorizontalAlignment="Center"
15851585
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
@@ -1595,7 +1595,7 @@
15951595
<Button x:Name="PART_PinClose"
15961596
shell:WindowChrome.IsHitTestVisibleInChrome="True"
15971597
Focusable="False"
1598-
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
1598+
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
15991599
VerticalAlignment="Center"
16001600
HorizontalAlignment="Center"
16011601
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"

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

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ internal class AutoHideWindowManager
2727

2828
private DockingManager _manager;
2929
private WeakReference _currentAutohiddenAnchor = null;
30+
private DispatcherTimer _closingTimer = null;
3031
private DispatcherTimer _closeTimer = null;
3132

3233
#endregion
@@ -36,9 +37,15 @@ internal class AutoHideWindowManager
3637
internal AutoHideWindowManager( DockingManager manager )
3738
{
3839
_manager = manager;
40+
this.SetupClosingTimer();
3941
this.SetupCloseTimer();
4042
}
4143

44+
internal void UpdateCloseTimerInterval( int newValue )
45+
{
46+
_closeTimer.Interval = TimeSpan.FromMilliseconds( newValue );
47+
}
48+
4249
#endregion
4350

4451
#region Private Methods
@@ -47,10 +54,11 @@ public void ShowAutoHideWindow( LayoutAnchorControl anchor )
4754
{
4855
if( _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>() != anchor )
4956
{
50-
StopCloseTimer();
57+
this.StopClosingTimer();
58+
this.StopCloseTimer();
5159
_currentAutohiddenAnchor = new WeakReference( anchor );
5260
_manager.AutoHideWindow.Show( anchor );
53-
StartCloseTimer();
61+
this.StartClosingTimer();
5462
}
5563
}
5664

@@ -59,24 +67,55 @@ public void HideAutoWindow( LayoutAnchorControl anchor = null )
5967
if( anchor == null ||
6068
anchor == _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>() )
6169
{
62-
StopCloseTimer();
70+
this.StopClosingTimer();
71+
this.StopCloseTimer();
6372
}
6473
else
6574
System.Diagnostics.Debug.Assert( false );
6675
}
6776

77+
private void SetupClosingTimer()
78+
{
79+
_closingTimer = new DispatcherTimer( DispatcherPriority.Background );
80+
_closingTimer.Interval = TimeSpan.FromMilliseconds( 50 );
81+
_closingTimer.Tick += ( s, e ) =>
82+
{
83+
if( _manager.AutoHideWindow.IsWin32MouseOver
84+
|| ( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive
85+
|| _manager.AutoHideWindow.IsResizing )
86+
return;
87+
88+
this.StopClosingTimer();
89+
this.StartCloseTimer();
90+
};
91+
}
92+
93+
private void StartClosingTimer()
94+
{
95+
_closingTimer.Start();
96+
}
97+
98+
private void StopClosingTimer()
99+
{
100+
_closingTimer.Stop();
101+
}
102+
68103
private void SetupCloseTimer()
69104
{
70105
_closeTimer = new DispatcherTimer( DispatcherPriority.Background );
71-
_closeTimer.Interval = TimeSpan.FromMilliseconds( 1500 );
106+
_closeTimer.Interval = TimeSpan.FromMilliseconds( _manager.AutoHideWindowClosingTimer );
72107
_closeTimer.Tick += ( s, e ) =>
73108
{
74-
if( _manager.AutoHideWindow.IsWin32MouseOver ||
75-
( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive ||
76-
_manager.AutoHideWindow.IsResizing )
109+
if( _manager.AutoHideWindow.IsWin32MouseOver
110+
|| ( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive
111+
|| _manager.AutoHideWindow.IsResizing )
112+
{
113+
_closeTimer.Stop();
114+
this.StartClosingTimer();
77115
return;
116+
}
78117

79-
StopCloseTimer();
118+
this.StopCloseTimer();
80119
};
81120
}
82121

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
2525
using Xceed.Wpf.AvalonDock.Layout;
2626
using System.Windows.Media;
2727
using System.Windows.Threading;
28+
using System.Reflection;
2829

2930
namespace Xceed.Wpf.AvalonDock.Controls
3031
{
@@ -56,7 +57,40 @@ internal static void SetupFocusManagement( DockingManager manager )
5657
_windowHandler.Attach();
5758

5859
if( Application.Current != null )
59-
Application.Current.Exit += new ExitEventHandler( Current_Exit );
60+
{
61+
var currentDispatcher = Application.Current.Dispatcher;
62+
if( currentDispatcher != null )
63+
{
64+
if( currentDispatcher.CheckAccess() )
65+
{
66+
Application.Current.Exit += new ExitEventHandler( Current_Exit );
67+
}
68+
else
69+
{
70+
var disableProcessingCountFieldInfo = typeof( Dispatcher ).GetField( "_disableProcessingCount", BindingFlags.Instance | BindingFlags.NonPublic );
71+
if( disableProcessingCountFieldInfo != null )
72+
{
73+
var disableProcessingCountFieldInfoValue = disableProcessingCountFieldInfo.GetValue( currentDispatcher );
74+
if( ( disableProcessingCountFieldInfoValue != null ) && ( disableProcessingCountFieldInfoValue is int ) )
75+
{
76+
var action = new Action( () => Application.Current.Exit += new ExitEventHandler( Current_Exit ) );
77+
78+
if( ( int )disableProcessingCountFieldInfoValue == 0 )
79+
{
80+
// in sync
81+
currentDispatcher.Invoke( DispatcherPriority.Normal, action );
82+
}
83+
else
84+
{
85+
// in async.
86+
currentDispatcher.BeginInvoke( DispatcherPriority.Normal, action );
87+
}
88+
}
89+
}
90+
}
91+
}
92+
93+
}
6094
}
6195

6296
manager.PreviewGotKeyboardFocus += new KeyboardFocusChangedEventHandler( manager_PreviewGotKeyboardFocus );

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,26 +331,50 @@ protected override void InitDefaultCommands()
331331
base.InitDefaultCommands();
332332
}
333333

334+
protected override void ClearDefaultCommands()
335+
{
336+
_defaultHideCommand = null;
337+
_defaultAutoHideCommand = null;
338+
_defaultDockCommand = null;
339+
340+
base.ClearDefaultCommands();
341+
}
342+
334343
protected override void ClearDefaultBindings()
335344
{
336-
if( HideCommand == _defaultHideCommand )
345+
if( this.HideCommand == _defaultHideCommand )
346+
{
337347
BindingOperations.ClearBinding( this, HideCommandProperty );
338-
if( AutoHideCommand == _defaultAutoHideCommand )
348+
this.HideCommand = null;
349+
}
350+
if( this.AutoHideCommand == _defaultAutoHideCommand )
351+
{
339352
BindingOperations.ClearBinding( this, AutoHideCommandProperty );
340-
if( DockCommand == _defaultDockCommand )
353+
this.AutoHideCommand = null;
354+
}
355+
if( this.DockCommand == _defaultDockCommand )
356+
{
341357
BindingOperations.ClearBinding( this, DockCommandProperty );
358+
this.DockCommand = null;
359+
}
342360

343361
base.ClearDefaultBindings();
344362
}
345363

346364
protected override void SetDefaultBindings()
347365
{
348-
if( HideCommand == null )
366+
if( this.HideCommand == null )
367+
{
349368
this.SetCurrentValue( LayoutAnchorableItem.HideCommandProperty, _defaultHideCommand );
350-
if( AutoHideCommand == null )
369+
}
370+
if( this.AutoHideCommand == null )
371+
{
351372
this.SetCurrentValue( LayoutAnchorableItem.AutoHideCommandProperty, _defaultAutoHideCommand );
352-
if( DockCommand == null )
373+
}
374+
if( this.DockCommand == null )
375+
{
353376
this.SetCurrentValue( LayoutAnchorableItem.DockCommandProperty, _defaultDockCommand );
377+
}
354378

355379
this.SetCurrentValue( LayoutAnchorableItem.VisibilityProperty, _anchorable.IsVisible ? Visibility.Visible : System.Windows.Visibility.Hidden );
356380
base.SetDefaultBindings();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ protected override void OnVisibilityChanged()
117117

118118

119119

120+
121+
120122
internal override void Attach( LayoutContent model )
121123
{
122124
_document = model as LayoutDocument;

0 commit comments

Comments
 (0)