Browse Source

V4.3.0 Released

pull/1788/head 4.3.0
Simon Boucher 4 years ago
parent
commit
a20eb81655
  1. 26
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock.Themes.Aero/Theme.xaml
  2. 55
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/AutoHideWindowManager.cs
  3. 36
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/FocusElementManager.cs
  4. 36
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutAnchorableItem.cs
  5. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutDocumentItem.cs
  6. 137
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/LayoutItem.cs
  7. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Controls/NavigatorWindow.cs
  8. 245
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/DockingManager.cs
  9. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutContent.cs
  10. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutDocumentPane.cs
  11. 13
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutGroup.cs
  12. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutRoot.cs
  13. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml
  14. 49
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockPropertiesView.xaml.cs.txt
  15. 664
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockPropertiesView.xaml.txt
  16. 117
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockSourcesView.xaml.cs.txt
  17. 102
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockSourcesView.xaml.txt
  18. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ButtonSpinnerView.xaml.txt
  19. 76
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAdvancedContextMenuView.xaml.cs.txt
  20. 38
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAdvancedContextMenuView.xaml.txt
  21. 52
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs.txt
  22. 45
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorComboBoxDefinitionSourceView.xaml.txt
  23. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.cs.txt
  24. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.txt
  25. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt
  26. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt
  27. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt
  28. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt
  29. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt
  30. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt
  31. 27
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimeSpanView.xaml.txt
  32. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/MainWindow.xaml
  33. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Properties/AssemblyInfo.cs
  34. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Document.cs
  35. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentBase.cs
  36. 46
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentView.xaml
  37. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentView.xaml.cs
  38. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Note.cs
  39. 31
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/NoteView.xaml
  40. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/NoteView.xaml.cs
  41. 28
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Page.cs
  42. 31
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/PageView.xaml
  43. 32
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/PageView.xaml.cs
  44. 664
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockPropertiesView.xaml
  45. 49
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockPropertiesView.xaml.cs
  46. 102
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockSourcesView.xaml
  47. 117
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockSourcesView.xaml.cs
  48. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/ButtonSpinnerView.xaml
  49. BIN
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/OpenSourceImages/EditorComboBoxDefinition.png
  50. 38
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAdvancedContextMenuView.xaml
  51. 76
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAdvancedContextMenuView.xaml.cs
  52. 45
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridEditorComboBoxDefinitionSourceView.xaml
  53. 52
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs
  54. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridPropertyItemStyleView.xaml
  55. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridPropertyItemStyleView.xaml.cs
  56. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingAvalonDockView.xaml
  57. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingCoreWPFView.xaml
  58. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingDataGridView.xaml
  59. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingExtendedToolkitView.xaml
  60. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingExtendedToolkitView.xaml.cs
  61. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingListBoxView.xaml
  62. 27
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/TimeSpan/Views/TimeSpanView.xaml
  63. 82
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Xceed.Wpf.Toolkit.LiveExplorer.csproj
  64. 8
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/app.config
  65. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/AssemblyVersionInfo.cs
  66. 24
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs
  67. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Aero2.NormalColor.xaml
  68. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Generic.xaml
  69. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml
  70. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml
  71. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControl.cs
  72. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs
  73. 37
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/PrintableFontFamilyConverter.cs
  74. 11
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/FontUtilities.cs
  75. 12
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/ListUtilities.cs
  76. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml
  77. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml
  78. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml
  79. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Generic.xaml
  80. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml
  81. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml
  82. 38
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs
  83. 5
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Properties/AssemblyInfo.cs
  84. 55
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Attributes/CategoryPropertyOrderAttribute.cs
  85. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Converters/PropertyItemEditorConverter.cs
  86. 23
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/CollectionEditor.cs
  87. 15
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGrid.cs
  88. 51
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGridContextMenu.cs
  89. 3
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyItemCollection.cs
  90. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml
  91. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml
  92. 6
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBar.cs
  93. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/Themes/Aero2.NormalColor.xaml
  94. 7
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/Themes/Generic.xaml
  95. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Glyphs.xaml
  96. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Glyphs.xaml
  97. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml
  98. 2
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Generic.xaml
  99. 129
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Implementation/TimeSpanUpDown.cs
  100. 1
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Aero2.NormalColor.xaml

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

@ -83,7 +83,7 @@
KeyboardNavigation.TabIndex="1"
KeyboardNavigation.DirectionalNavigation="Cycle"/>
<avalonDockControls:DropDownButton x:Name="MenuDropDownButton"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
VerticalAlignment="Center"
Grid.Column="1">
@ -473,7 +473,7 @@
<avalonDockControls:DropDownButton x:Name="MenuDropDownButton"
VerticalAlignment="Center"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1"
Padding="-1"
@ -489,7 +489,7 @@
Grid.Column="2"
Focusable="False"
Padding="-1"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Command="{Binding Path=LayoutItem.AutoHideCommand, RelativeSource={RelativeSource TemplatedParent}}"
@ -503,7 +503,7 @@
Grid.Column="3"
Focusable="False"
Padding="-1"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
@ -1181,7 +1181,7 @@
ContentTemplateSelector="{Binding Root.Manager.DocumentHeaderTemplateSelector, Mode=OneWay}" />
<!-- Close button should be moved out to the container style -->
<Button x:Name="DocumentCloseButton"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Grid.Column="2"
@ -1355,7 +1355,7 @@
<avalonDockControls:DropDownButton x:Name="ContextMenuDropdownButton"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1"
VerticalAlignment="Center"
@ -1376,7 +1376,7 @@
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
@ -1391,7 +1391,7 @@
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
@ -1405,7 +1405,7 @@
<Button x:Name="PART_PinClose"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
@ -1539,7 +1539,7 @@
<avalonDockControls:DropDownButton x:Name="SinglePaneContextMenu"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1"
VerticalAlignment="Center"
@ -1560,7 +1560,7 @@
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
VerticalContentAlignment="Center"
@ -1579,7 +1579,7 @@
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
@ -1595,7 +1595,7 @@
<Button x:Name="PART_PinClose"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"

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

@ -27,6 +27,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
private DockingManager _manager;
private WeakReference _currentAutohiddenAnchor = null;
private DispatcherTimer _closingTimer = null;
private DispatcherTimer _closeTimer = null;
#endregion
@ -36,9 +37,15 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal AutoHideWindowManager( DockingManager manager )
{
_manager = manager;
this.SetupClosingTimer();
this.SetupCloseTimer();
}
internal void UpdateCloseTimerInterval( int newValue )
{
_closeTimer.Interval = TimeSpan.FromMilliseconds( newValue );
}
#endregion
#region Private Methods
@ -47,10 +54,11 @@ namespace Xceed.Wpf.AvalonDock.Controls
{
if( _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>() != anchor )
{
StopCloseTimer();
this.StopClosingTimer();
this.StopCloseTimer();
_currentAutohiddenAnchor = new WeakReference( anchor );
_manager.AutoHideWindow.Show( anchor );
StartCloseTimer();
this.StartClosingTimer();
}
}
@ -59,24 +67,55 @@ namespace Xceed.Wpf.AvalonDock.Controls
if( anchor == null ||
anchor == _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>() )
{
StopCloseTimer();
this.StopClosingTimer();
this.StopCloseTimer();
}
else
System.Diagnostics.Debug.Assert( false );
}
private void SetupClosingTimer()
{
_closingTimer = new DispatcherTimer( DispatcherPriority.Background );
_closingTimer.Interval = TimeSpan.FromMilliseconds( 50 );
_closingTimer.Tick += ( s, e ) =>
{
if( _manager.AutoHideWindow.IsWin32MouseOver
|| ( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive
|| _manager.AutoHideWindow.IsResizing )
return;
this.StopClosingTimer();
this.StartCloseTimer();
};
}
private void StartClosingTimer()
{
_closingTimer.Start();
}
private void StopClosingTimer()
{
_closingTimer.Stop();
}
private void SetupCloseTimer()
{
_closeTimer = new DispatcherTimer( DispatcherPriority.Background );
_closeTimer.Interval = TimeSpan.FromMilliseconds( 1500 );
_closeTimer.Interval = TimeSpan.FromMilliseconds( _manager.AutoHideWindowClosingTimer );
_closeTimer.Tick += ( s, e ) =>
{
if( _manager.AutoHideWindow.IsWin32MouseOver ||
( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive ||
_manager.AutoHideWindow.IsResizing )
if( _manager.AutoHideWindow.IsWin32MouseOver
|| ( ( LayoutAnchorable )_manager.AutoHideWindow.Model ).IsActive
|| _manager.AutoHideWindow.IsResizing )
{
_closeTimer.Stop();
this.StartClosingTimer();
return;
}
StopCloseTimer();
this.StopCloseTimer();
};
}

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

@ -25,6 +25,7 @@ using System.Diagnostics;
using Xceed.Wpf.AvalonDock.Layout;
using System.Windows.Media;
using System.Windows.Threading;
using System.Reflection;
namespace Xceed.Wpf.AvalonDock.Controls
{
@ -56,7 +57,40 @@ namespace Xceed.Wpf.AvalonDock.Controls
_windowHandler.Attach();
if( Application.Current != null )
Application.Current.Exit += new ExitEventHandler( Current_Exit );
{
var currentDispatcher = Application.Current.Dispatcher;
if( currentDispatcher != null )
{
if( currentDispatcher.CheckAccess() )
{
Application.Current.Exit += new ExitEventHandler( Current_Exit );
}
else
{
var disableProcessingCountFieldInfo = typeof( Dispatcher ).GetField( "_disableProcessingCount", BindingFlags.Instance | BindingFlags.NonPublic );
if( disableProcessingCountFieldInfo != null )
{
var disableProcessingCountFieldInfoValue = disableProcessingCountFieldInfo.GetValue( currentDispatcher );
if( ( disableProcessingCountFieldInfoValue != null ) && ( disableProcessingCountFieldInfoValue is int ) )
{
var action = new Action( () => Application.Current.Exit += new ExitEventHandler( Current_Exit ) );
if( ( int )disableProcessingCountFieldInfoValue == 0 )
{
// in sync
currentDispatcher.Invoke( DispatcherPriority.Normal, action );
}
else
{
// in async.
currentDispatcher.BeginInvoke( DispatcherPriority.Normal, action );
}
}
}
}
}
}
}
manager.PreviewGotKeyboardFocus += new KeyboardFocusChangedEventHandler( manager_PreviewGotKeyboardFocus );

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

@ -331,26 +331,50 @@ namespace Xceed.Wpf.AvalonDock.Controls
base.InitDefaultCommands();
}
protected override void ClearDefaultCommands()
{
_defaultHideCommand = null;
_defaultAutoHideCommand = null;
_defaultDockCommand = null;
base.ClearDefaultCommands();
}
protected override void ClearDefaultBindings()
{
if( HideCommand == _defaultHideCommand )
if( this.HideCommand == _defaultHideCommand )
{
BindingOperations.ClearBinding( this, HideCommandProperty );
if( AutoHideCommand == _defaultAutoHideCommand )
this.HideCommand = null;
}
if( this.AutoHideCommand == _defaultAutoHideCommand )
{
BindingOperations.ClearBinding( this, AutoHideCommandProperty );
if( DockCommand == _defaultDockCommand )
this.AutoHideCommand = null;
}
if( this.DockCommand == _defaultDockCommand )
{
BindingOperations.ClearBinding( this, DockCommandProperty );
this.DockCommand = null;
}
base.ClearDefaultBindings();
}
protected override void SetDefaultBindings()
{
if( HideCommand == null )
if( this.HideCommand == null )
{
this.SetCurrentValue( LayoutAnchorableItem.HideCommandProperty, _defaultHideCommand );
if( AutoHideCommand == null )
}
if( this.AutoHideCommand == null )
{
this.SetCurrentValue( LayoutAnchorableItem.AutoHideCommandProperty, _defaultAutoHideCommand );
if( DockCommand == null )
}
if( this.DockCommand == null )
{
this.SetCurrentValue( LayoutAnchorableItem.DockCommandProperty, _defaultDockCommand );
}
this.SetCurrentValue( LayoutAnchorableItem.VisibilityProperty, _anchorable.IsVisible ? Visibility.Visible : System.Windows.Visibility.Hidden );
base.SetDefaultBindings();

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

@ -117,6 +117,8 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal override void Attach( LayoutContent model )
{
_document = model as LayoutDocument;

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

@ -41,7 +41,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
private ICommand _defaultNewHorizontalTabGroupCommand;
private ICommand _defaultMoveToNextTabGroupCommand;
private ICommand _defaultMoveToPreviousTabGroupCommand;
private ContentPresenter _view = null;
internal ContentPresenter _view = null;
private ReentrantFlag _isSelectedReentrantFlag = new ReentrantFlag();
private ReentrantFlag _isActiveReentrantFlag = new ReentrantFlag();
@ -1133,53 +1133,116 @@ namespace Xceed.Wpf.AvalonDock.Controls
_defaultMoveToPreviousTabGroupCommand = new RelayCommand( ( p ) => ExecuteMoveToPreviousTabGroupCommand( p ), ( p ) => CanExecuteMoveToPreviousTabGroupCommand( p ) );
}
protected virtual void ClearDefaultCommands()
{
_defaultCloseCommand = null;
_defaultFloatCommand = null;
_defaultDockAsDocumentCommand = null;
_defaultCloseAllButThisCommand = null;
_defaultCloseAllCommand = null;
_defaultActivateCommand = null;
_defaultNewVerticalTabGroupCommand = null;
_defaultNewHorizontalTabGroupCommand = null;
_defaultMoveToNextTabGroupCommand = null;
_defaultMoveToPreviousTabGroupCommand = null;
}
protected virtual void ClearDefaultBindings()
{
if( CloseCommand == _defaultCloseCommand )
if( this.CloseCommand == _defaultCloseCommand )
{
BindingOperations.ClearBinding( this, CloseCommandProperty );
if( FloatCommand == _defaultFloatCommand )
this.CloseCommand = null;
}
if( this.FloatCommand == _defaultFloatCommand )
{
BindingOperations.ClearBinding( this, FloatCommandProperty );
if( DockAsDocumentCommand == _defaultDockAsDocumentCommand )
this.FloatCommand = null;
}
if( this.DockAsDocumentCommand == _defaultDockAsDocumentCommand )
{
BindingOperations.ClearBinding( this, DockAsDocumentCommandProperty );
if( CloseAllButThisCommand == _defaultCloseAllButThisCommand )
this.DockAsDocumentCommand = null;
}
if( this.CloseAllButThisCommand == _defaultCloseAllButThisCommand )
{
BindingOperations.ClearBinding( this, CloseAllButThisCommandProperty );
if( CloseAllCommand == _defaultCloseAllCommand )
this.CloseAllButThisCommand = null;
}
if( this.CloseAllCommand == _defaultCloseAllCommand )
{
BindingOperations.ClearBinding( this, CloseAllCommandProperty );
if( ActivateCommand == _defaultActivateCommand )
this.CloseAllCommand = null;
}
if( this.ActivateCommand == _defaultActivateCommand )
{
BindingOperations.ClearBinding( this, ActivateCommandProperty );
if( NewVerticalTabGroupCommand == _defaultNewVerticalTabGroupCommand )
this.ActivateCommand = null;
}
if( this.NewVerticalTabGroupCommand == _defaultNewVerticalTabGroupCommand )
{
BindingOperations.ClearBinding( this, NewVerticalTabGroupCommandProperty );
if( NewHorizontalTabGroupCommand == _defaultNewHorizontalTabGroupCommand )
this.NewVerticalTabGroupCommand = null;
}
if( this.NewHorizontalTabGroupCommand == _defaultNewHorizontalTabGroupCommand )
{
BindingOperations.ClearBinding( this, NewHorizontalTabGroupCommandProperty );
if( MoveToNextTabGroupCommand == _defaultMoveToNextTabGroupCommand )
this.NewHorizontalTabGroupCommand = null;
}
if( this.MoveToNextTabGroupCommand == _defaultMoveToNextTabGroupCommand )
{
BindingOperations.ClearBinding( this, MoveToNextTabGroupCommandProperty );
if( MoveToPreviousTabGroupCommand == _defaultMoveToPreviousTabGroupCommand )
this.MoveToNextTabGroupCommand = null;
}
if( this.MoveToPreviousTabGroupCommand == _defaultMoveToPreviousTabGroupCommand )
{
BindingOperations.ClearBinding( this, MoveToPreviousTabGroupCommandProperty );
this.MoveToPreviousTabGroupCommand = null;
}
}
protected virtual void SetDefaultBindings()
{
if( CloseCommand == null )
if( this.CloseCommand == null )
{
this.SetCurrentValue( LayoutItem.CloseCommandProperty, _defaultCloseCommand );
if( FloatCommand == null )
}
if( this.FloatCommand == null )
{
this.SetCurrentValue( LayoutItem.FloatCommandProperty, _defaultFloatCommand );
if( DockAsDocumentCommand == null )
}
if( this.DockAsDocumentCommand == null )
{
this.SetCurrentValue( LayoutItem.DockAsDocumentCommandProperty, _defaultDockAsDocumentCommand );
if( CloseAllButThisCommand == null )
}
if( this.CloseAllButThisCommand == null )
{
this.SetCurrentValue( LayoutItem.CloseAllButThisCommandProperty, _defaultCloseAllButThisCommand );
if( CloseAllCommand == null )
}
if( this.CloseAllCommand == null )
{
this.SetCurrentValue( LayoutItem.CloseAllCommandProperty, _defaultCloseAllCommand );
if( ActivateCommand == null )
}
if( this.ActivateCommand == null )
{
this.SetCurrentValue( LayoutItem.ActivateCommandProperty, _defaultActivateCommand );
if( NewVerticalTabGroupCommand == null )
}
if( this.NewVerticalTabGroupCommand == null )
{
this.SetCurrentValue( LayoutItem.NewVerticalTabGroupCommandProperty, _defaultNewVerticalTabGroupCommand );
if( NewHorizontalTabGroupCommand == null )
}
if( this.NewHorizontalTabGroupCommand == null )
{
this.SetCurrentValue( LayoutItem.NewHorizontalTabGroupCommandProperty, _defaultNewHorizontalTabGroupCommand );
if( MoveToNextTabGroupCommand == null )
}
if( this.MoveToNextTabGroupCommand == null )
{
this.SetCurrentValue( LayoutItem.MoveToNextTabGroupCommandProperty, _defaultMoveToNextTabGroupCommand );
if( MoveToPreviousTabGroupCommand == null )
}
if( this.MoveToPreviousTabGroupCommand == null )
{
this.SetCurrentValue( LayoutItem.MoveToPreviousTabGroupCommandProperty, _defaultMoveToPreviousTabGroupCommand );
}
this.SetCurrentValue( LayoutItem.IsSelectedProperty, LayoutElement.IsSelected );
this.SetCurrentValue( LayoutItem.IsActiveProperty, LayoutElement.IsActive );
@ -1188,30 +1251,34 @@ namespace Xceed.Wpf.AvalonDock.Controls
protected virtual void OnVisibilityChanged()
{
if( LayoutElement != null &&
Visibility == System.Windows.Visibility.Collapsed )
if( LayoutElement != null && Visibility == System.Windows.Visibility.Collapsed )
LayoutElement.Close();
}
internal virtual void Attach( LayoutContent model )
{
LayoutElement = model;
Model = model.Content;
this.LayoutElement = model;
this.Model = model.Content;
InitDefaultCommands();
this.InitDefaultCommands();
LayoutElement.IsSelectedChanged += new EventHandler( LayoutElement_IsSelectedChanged );
LayoutElement.IsActiveChanged += new EventHandler( LayoutElement_IsActiveChanged );
this.LayoutElement.IsSelectedChanged += new EventHandler( LayoutElement_IsSelectedChanged );
this.LayoutElement.IsActiveChanged += new EventHandler( LayoutElement_IsActiveChanged );
DataContext = this;
this.DataContext = this;
}
internal virtual void Detach()
{
LayoutElement.IsSelectedChanged -= new EventHandler( LayoutElement_IsSelectedChanged );
LayoutElement.IsActiveChanged -= new EventHandler( LayoutElement_IsActiveChanged );
LayoutElement = null;
Model = null;
this.ClearDefaultCommands();
this.LayoutElement.IsSelectedChanged -= new EventHandler( LayoutElement_IsSelectedChanged );
this.LayoutElement.IsActiveChanged -= new EventHandler( LayoutElement_IsActiveChanged );
this.LayoutElement = null;
this.Model = null;
this.DataContext = null;
}
internal void _ClearDefaultBindings()
@ -1239,9 +1306,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{
using( _isActiveReentrantFlag.Enter() )
{
var bnd = BindingOperations.GetBinding( this, IsActiveProperty );
IsActive = LayoutElement.IsActive;
var bnd2 = BindingOperations.GetBinding( this, IsActiveProperty );
}
}
}

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

@ -55,21 +55,21 @@ namespace Xceed.Wpf.AvalonDock.Controls
ShowInTaskbarProperty.OverrideMetadata( typeof( NavigatorWindow ), new FrameworkPropertyMetadata( false ) );
}
internal NavigatorWindow( DockingManager manager )
public NavigatorWindow( DockingManager manager )
{
_manager = manager;
_internalSetSelectedDocument = true;
this.SetAnchorables( _manager.Layout.Descendents().OfType<LayoutAnchorable>().Where( a => a.IsVisible ).Select( d => (LayoutAnchorableItem)_manager.GetLayoutItemFromModel( d ) ).ToArray() );
this.SetDocuments( _manager.Layout.Descendents().OfType<LayoutDocument>().OrderByDescending( d => d.LastActivationTimeStamp.GetValueOrDefault() ).Select( d => (LayoutDocumentItem)_manager.GetLayoutItemFromModel( d ) ).ToArray() );
this.SetAnchorables( _manager.Layout.Descendents().OfType<LayoutAnchorable>().Where( a => a.IsVisible && a.IsEnabled).Select( d => (LayoutAnchorableItem)_manager.GetLayoutItemFromModel( d ) ).ToArray() );
this.SetDocuments( _manager.Layout.Descendents().OfType<LayoutDocument>().Where( d => d.IsEnabled ).OrderByDescending( d => d.LastActivationTimeStamp.GetValueOrDefault() ).Select( d => (LayoutDocumentItem)_manager.GetLayoutItemFromModel( d ) ).ToArray() );
_internalSetSelectedDocument = false;
if( this.Documents.Length > 1 )
if( ( this.Documents != null) && (this.Documents.Length > 1) )
{
this.InternalSetSelectedDocument( this.Documents[ 1 ] );
_isSelectingDocument = true;
}
else if( this.Anchorables.Count() > 1 )
else if( (this.Anchorables != null) && (this.Anchorables.Count() > 1) )
{
this.InternalSetSelectedAnchorable( this.Anchorables.ToArray()[ 1 ] );
_isSelectingDocument = false;
@ -262,7 +262,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
// Selecting LayoutDocuments
if( _isSelectingDocument )
{
if( this.SelectedDocument != null )
if( (this.SelectedDocument != null) && ( this.Documents != null) )
{
var docIndex = this.Documents.IndexOf<LayoutDocumentItem>( this.SelectedDocument );
@ -270,6 +270,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
{
// Jump to next LayoutDocument
if( ( docIndex < ( this.Documents.Length - 1 ) )
|| (this.Anchorables == null)
|| ( this.Anchorables.Count() == 0 ) )
{
this.SelectNextDocument();
@ -298,7 +299,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
}
else if( ( e.Key == System.Windows.Input.Key.Left ) || ( e.Key == System.Windows.Input.Key.Right ) )
{
if( this.Anchorables.Count() > 0 )
if( (this.Anchorables != null) && (this.Anchorables.Count() > 0) )
{
_isSelectingDocument = false;
this.InternalSetSelectedDocument( null );
@ -318,7 +319,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
// There is no SelectedDocument, select the first one.
else
{
if( this.Documents.Length > 0 )
if( ( this.Documents != null ) && (this.Documents.Length > 0) )
{
this.InternalSetSelectedDocument( this.Documents[ 0 ] );
shouldHandle = true;
@ -330,19 +331,19 @@ namespace Xceed.Wpf.AvalonDock.Controls
{
if( this.SelectedAnchorable != null )
{
var anchorableIndex = this.Anchorables.ToArray().IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable );
var anchorableIndex = ( this.Anchorables != null) ? this.Anchorables.ToArray().IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable ) : -1;
if( e.Key == System.Windows.Input.Key.Tab )
{
// Jump to next LayoutAnchorable
if( ( anchorableIndex < ( this.Anchorables.Count() - 1 ) )
|| ( this.Documents.Length == 0 ) )
if( ( ( this.Anchorables != null) && ( anchorableIndex < ( this.Anchorables.Count() - 1 ) ) )
|| ( ( this.Documents != null ) && ( this.Documents.Length == 0 ) ) )
{
this.SelectNextAnchorable();
shouldHandle = true;
}
// Jump to first LayoutDocument
else if( this.Documents.Length > 0 )
else if( ( this.Documents != null) && (this.Documents.Length > 0) )
{
_isSelectingDocument = true;
this.InternalSetSelectedAnchorable( null );
@ -364,7 +365,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
}
else if( ( e.Key == System.Windows.Input.Key.Left ) || ( e.Key == System.Windows.Input.Key.Right ) )
{
if( this.Documents.Count() > 0 )
if( ( this.Documents != null) && (this.Documents.Count() > 0) )
{
_isSelectingDocument = true;
this.InternalSetSelectedAnchorable( null );
@ -383,7 +384,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
// There is no SelectedAnchorable, select the first one.
else
{
if( this.Anchorables.Count() > 0 )
if( ( this.Anchorables != null) && (this.Anchorables.Count() > 0) )
{
this.InternalSetSelectedAnchorable( this.Anchorables.ToArray()[ 0 ] );
shouldHandle = true;
@ -493,7 +494,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void SelectNextDocument()
{
if( this.SelectedDocument != null )
if( (this.SelectedDocument != null) && ( this.Documents != null) )
{
int docIndex = this.Documents.IndexOf<LayoutDocumentItem>( this.SelectedDocument );
docIndex++;
@ -507,7 +508,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void SelectPreviousDocument()
{
if( this.SelectedDocument != null )
if( (this.SelectedDocument != null) && ( this.Documents != null) )
{
int docIndex = this.Documents.IndexOf<LayoutDocumentItem>( this.SelectedDocument );
docIndex--;
@ -521,7 +522,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void SelectNextAnchorable()
{
if( this.SelectedAnchorable != null )
if( (this.SelectedAnchorable != null) && ( this.Anchorables != null) )
{
var anchorablesArray = this.Anchorables.ToArray();
int anchorableIndex = anchorablesArray.IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable );
@ -536,7 +537,7 @@ namespace Xceed.Wpf.AvalonDock.Controls
internal void SelectPreviousAnchorable()
{
if( this.SelectedAnchorable != null )
if( (this.SelectedAnchorable != null) && ( this.Anchorables != null ) )
{
var anchorablesArray = this.Anchorables.ToArray();
int anchorableIndex = anchorablesArray.IndexOf<LayoutAnchorableItem>( this.SelectedAnchorable );

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

@ -57,7 +57,7 @@ namespace Xceed.Wpf.AvalonDock
private NavigatorWindow _navigatorWindow = null;
internal bool SuspendDocumentsSourceBinding = false;
internal bool SuspendAnchorablesSourceBinding = false;
internal bool SuspendAnchorablesSourceBinding = false;
#endregion
@ -248,88 +248,6 @@ namespace Xceed.Wpf.AvalonDock
#endregion
#region DocumentPaneTemplate
/// <summary>
/// DocumentPaneTemplate Dependency Property
/// </summary>
public static readonly DependencyProperty DocumentPaneTemplateProperty = DependencyProperty.Register( "DocumentPaneTemplate", typeof( ControlTemplate ), typeof( DockingManager ),
new FrameworkPropertyMetadata( ( ControlTemplate )null, new PropertyChangedCallback( OnDocumentPaneTemplateChanged ) ) );
/// <summary>
/// Gets or sets the DocumentPaneDataTemplate property. This dependency property
/// indicates .
/// </summary>
public ControlTemplate DocumentPaneTemplate
{
get
{
return ( ControlTemplate )GetValue( DocumentPaneTemplateProperty );
}
set
{
SetValue( DocumentPaneTemplateProperty, value );
}
}
/// <summary>
/// Handles changes to the DocumentPaneTemplate property.
/// </summary>
private static void OnDocumentPaneTemplateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
( ( DockingManager )d ).OnDocumentPaneTemplateChanged( e );
}
/// <summary>
/// Provides derived classes an opportunity to handle changes to the DocumentPaneTemplate property.
/// </summary>
protected virtual void OnDocumentPaneTemplateChanged( DependencyPropertyChangedEventArgs e )
{
}
#endregion
#region AnchorablePaneTemplate
/// <summary>
/// AnchorablePaneTemplate Dependency Property
/// </summary>
public static readonly DependencyProperty AnchorablePaneTemplateProperty = DependencyProperty.Register( "AnchorablePaneTemplate", typeof( ControlTemplate ), typeof( DockingManager ),
new FrameworkPropertyMetadata( ( ControlTemplate )null, new PropertyChangedCallback( OnAnchorablePaneTemplateChanged ) ) );
/// <summary>
/// Gets or sets the AnchorablePaneTemplate property. This dependency property
/// indicates ....
/// </summary>
public ControlTemplate AnchorablePaneTemplate
{
get
{
return ( ControlTemplate )GetValue( AnchorablePaneTemplateProperty );
}
set
{
SetValue( AnchorablePaneTemplateProperty, value );
}
}
/// <summary>
/// Handles changes to the AnchorablePaneDataTemplate property.
/// </summary>
private static void OnAnchorablePaneTemplateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
( ( DockingManager )d ).OnAnchorablePaneTemplateChanged( e );
}
/// <summary>
/// Provides derived classes an opportunity to handle changes to the AnchorablePaneDataTemplate property.
/// </summary>
protected virtual void OnAnchorablePaneTemplateChanged( DependencyPropertyChangedEventArgs e )
{
}
#endregion
#region AnchorSideTemplate
/// <summary>
@ -1157,14 +1075,18 @@ namespace Xceed.Wpf.AvalonDock
{
var wrToRemove = _logicalChildren.FirstOrDefault( ch => ch.GetValueOrDefault<object>() == element );
if( wrToRemove != null )
{
_logicalChildren.Remove( wrToRemove );
RemoveLogicalChild( element );
}
this.RemoveLogicalChild( element );
}
private void ClearLogicalChildrenList()
{
foreach( var child in _logicalChildren.Select( ch => ch.GetValueOrDefault<object>() ).ToArray() )
RemoveLogicalChild( child );
{
this.RemoveLogicalChild( child );
}
_logicalChildren.Clear();
}
@ -1224,6 +1146,54 @@ namespace Xceed.Wpf.AvalonDock
#endregion
#region AutoHideWindowClosingTimer
/// <summary>
/// AutoHideWindowClosingTimer Dependency Property
/// </summary>
public static readonly DependencyProperty AutoHideWindowClosingTimerProperty = DependencyProperty.Register( "AutoHideWindowClosingTimer", typeof( int ), typeof( DockingManager ),
new FrameworkPropertyMetadata( ( int )1500, new PropertyChangedCallback( OnAutoHideWindowClosingTimerChanged ), new CoerceValueCallback( CoerceAutoHideWindowClosingTimer ) ) );
/// <summary>
/// Gets or sets the AutoHideWindowClosingTimer property. This dependency property
/// indicates how long it will take to close the AutoHideWindow when not moused over or active.
/// </summary>
public int AutoHideWindowClosingTimer
{
get
{
return ( int )GetValue( AutoHideWindowClosingTimerProperty );
}
set
{
SetValue( AutoHideWindowClosingTimerProperty, value );
}
}
private static void OnAutoHideWindowClosingTimerChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
( ( DockingManager )d ).OnAutoHideWindowClosingTimerChanged( e );
}
protected virtual void OnAutoHideWindowClosingTimerChanged( DependencyPropertyChangedEventArgs e )
{
if( _autoHideWindowManager != null )
{
_autoHideWindowManager.UpdateCloseTimerInterval( ( int )e.NewValue );
}
}
private static object CoerceAutoHideWindowClosingTimer( DependencyObject d, object value )
{
if( ( ( int )value ) >= 0 )
return value;
return 1500;
}
#endregion
#region Floating Windows
public IEnumerable<LayoutFloatingWindowControl> FloatingWindows
@ -2015,7 +1985,7 @@ namespace Xceed.Wpf.AvalonDock
else
{
var lac = current as LayoutAnchorableControl;
if( ( lac != null ) && ( this.AnchorableContextMenu != null) )
if( ( lac != null ) && ( this.AnchorableContextMenu != null ) )
{
this.AnchorableContextMenu.PlacementTarget = lac;
this.AnchorableContextMenu.Placement = PlacementMode.Relative;
@ -2034,6 +2004,11 @@ namespace Xceed.Wpf.AvalonDock
#region Public Methods
public virtual NavigatorWindow CreateNavigatorWindow()
{
return new NavigatorWindow( this );
}
/// <summary>
/// Return the LayoutItem wrapper for the content passed as argument
/// </summary>
@ -2124,6 +2099,9 @@ namespace Xceed.Wpf.AvalonDock
};
newFW.SetParentToMainWindowOf( this );
var mainWindow = Window.GetWindow( this );
newFW.InputBindings.AddRange( mainWindow.InputBindings );
var paneForExtensions = modelFW.RootPanel.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault();
if( paneForExtensions != null )
{
@ -2231,7 +2209,7 @@ namespace Xceed.Wpf.AvalonDock
internal void StartDraggingFloatingWindowForContent( LayoutContent contentModel, bool startDrag = true )
{
if( ( contentModel == null) || !contentModel.CanFloat )
if( ( contentModel == null ) || !contentModel.CanFloat )
return;
var fwc = this.CreateFloatingWindow( contentModel, false );
@ -2414,11 +2392,9 @@ namespace Xceed.Wpf.AvalonDock
{
if( _navigatorWindow == null )
{
_navigatorWindow = new NavigatorWindow( this )
{
Owner = Window.GetWindow( this ),
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
_navigatorWindow = this.CreateNavigatorWindow();
_navigatorWindow.Owner = Window.GetWindow( this );
_navigatorWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
}
_navigatorWindow.ShowDialog();
@ -2525,7 +2501,7 @@ namespace Xceed.Wpf.AvalonDock
fw.KeepContentVisibleOnClose = true;
fw.Close();
}
_fwList.Clear();
_fwList.Clear();
DestroyOverlayWindow();
FocusElementManager.FinalizeFocusManagement( this );
@ -2607,14 +2583,11 @@ namespace Xceed.Wpf.AvalonDock
_suspendLayoutItemCreation = true;
foreach( var documentContentToImport in listOfDocumentsToImport )
{
//documentPane.Children.Add(new LayoutDocument() { Content = documentToImport });
var documentToImport = new LayoutDocument()
{
Content = documentContentToImport,
ContentId = Guid.NewGuid().ToString()
};
};
bool added = false;
if( LayoutUpdateStrategy != null )
@ -2648,7 +2621,7 @@ namespace Xceed.Wpf.AvalonDock
}
}
private void documentsSourceElementsChanged( object sender, NotifyCollectionChangedEventArgs e )
private void DocumentsSourceElementsChanged( object sender, NotifyCollectionChangedEventArgs e )
{
if( Layout == null )
return;
@ -2664,12 +2637,16 @@ namespace Xceed.Wpf.AvalonDock
if( e.OldItems != null )
{
var documentsToRemove = Layout.Descendents().OfType<LayoutDocument>().Where( d => e.OldItems.Contains( d.Content ) ).ToArray();
foreach( var documentToRemove in documentsToRemove )
for( int i = 0; i < documentsToRemove.Count(); ++i )
{
//documentToRemove.Content = null;
( documentToRemove.Parent as ILayoutContainer ).RemoveChild(
documentToRemove );
var documentToRemove = documentsToRemove[ i ];
( documentToRemove.Parent as ILayoutContainer ).RemoveChild( documentToRemove );
this.RemoveViewFromLogicalChild( documentToRemove );
this.RemoveDocumentLayoutItem( documentToRemove );
documentToRemove.Content = null;
}
}
}
@ -2743,9 +2720,11 @@ namespace Xceed.Wpf.AvalonDock
var documentsToRemove = Layout.Descendents().OfType<LayoutDocument>().ToArray();
foreach( var documentToRemove in documentsToRemove )
{
( documentToRemove.Parent as ILayoutContainer ).RemoveChild(
documentToRemove );
( documentToRemove.Parent as ILayoutContainer ).RemoveChild( documentToRemove );
this.RemoveViewFromLogicalChild( documentToRemove );
this.RemoveDocumentLayoutItem( documentToRemove );
documentToRemove.Content = null;
}
}
@ -2768,8 +2747,7 @@ namespace Xceed.Wpf.AvalonDock
foreach( var documentToRemove in documentsToRemove )
{
( documentToRemove.Parent as ILayoutContainer ).RemoveChild(
documentToRemove );
( documentToRemove.Parent as ILayoutContainer ).RemoveChild( documentToRemove );
this.RemoveViewFromLogicalChild( documentToRemove );
}
@ -2778,6 +2756,8 @@ namespace Xceed.Wpf.AvalonDock
{
CollectionChangedEventManager.RemoveListener( documentsSourceAsNotifier, this );
}
this.Layout.CollectGarbage();
}
private void Close( LayoutContent contentToClose )
@ -3033,6 +3013,8 @@ namespace Xceed.Wpf.AvalonDock
{
CollectionChangedEventManager.RemoveListener( anchorablesSourceAsNotifier, this );
}
this.Layout.CollectGarbage();
}
private void RemoveViewFromLogicalChild( LayoutContent layoutContent )
@ -3045,7 +3027,10 @@ namespace Xceed.Wpf.AvalonDock
{
if( layoutItem.IsViewExists() )
{
BindingOperations.ClearAllBindings( layoutItem.View );
this.InternalRemoveLogicalChild( layoutItem.View );
layoutItem._view = null;
}
}
}
@ -3100,19 +3085,11 @@ namespace Xceed.Wpf.AvalonDock
_collectLayoutItemsOperations = Dispatcher.BeginInvoke( new Action( () =>
{
_collectLayoutItemsOperations = null;
foreach( var itemToRemove in _layoutItems.Where( item => item.LayoutElement.Root != Layout ).ToArray() )
var layoutItems = _layoutItems.Where( item => item.LayoutElement.Root != Layout ).ToArray();
for( int i = 0; i < layoutItems.Count(); ++i )
{
if( itemToRemove != null &&
itemToRemove.Model != null &&
itemToRemove.Model is UIElement )
{
//((ILogicalChildrenContainer)this).InternalRemoveLogicalChild(itemToRemove.Model as UIElement);
}
itemToRemove.Detach();
_layoutItems.Remove( itemToRemove );
var itemToRemove = layoutItems[ i ];
this.RemoveDocumentLayoutItem(itemToRemove.LayoutElement as LayoutDocument);
}
} ) );
}
@ -3200,7 +3177,24 @@ namespace Xceed.Wpf.AvalonDock
{
InternalAddLogicalChild( contentToAttach.Content );
}
}
private void RemoveDocumentLayoutItem( LayoutDocument contentToRemove )
{
var layoutItem = _layoutItems.FirstOrDefault( item => item.LayoutElement == contentToRemove );
if( layoutItem != null )
{
layoutItem._ClearDefaultBindings();
layoutItem.Detach();
_layoutItems.Remove( layoutItem );
if( contentToRemove != null &&
contentToRemove.Content != null &&
contentToRemove.Content is UIElement )
{
InternalRemoveLogicalChild( contentToRemove.Content );
}
}
}
private LayoutFloatingWindowControl CreateFloatingWindowForLayoutAnchorableWithoutParent( LayoutAnchorablePane paneModel, bool isContentImmutable )
@ -3280,6 +3274,9 @@ namespace Xceed.Wpf.AvalonDock
Left = fwLeft
};
var mainWindow = Window.GetWindow( this );
fwc.InputBindings.AddRange( mainWindow.InputBindings );
foreach( var layoutContent in destPane.Children )
{
layoutContent.IsFloating = true;
@ -3316,7 +3313,7 @@ namespace Xceed.Wpf.AvalonDock
if( contentModel.FindParent<LayoutFloatingWindow>() == null )
{
( (ILayoutPreviousContainer)contentModel ).PreviousContainer = parentPane;
( ( ILayoutPreviousContainer )contentModel ).PreviousContainer = parentPane;
contentModel.PreviousContainerIndex = contentModelParentChildrenIndex;
}
@ -3392,6 +3389,8 @@ namespace Xceed.Wpf.AvalonDock
//fwc.Owner = Window.GetWindow(this);
//fwc.SetParentToMainWindowOf(this);
var mainWindow = Window.GetWindow( this );
fwc.InputBindings.AddRange( mainWindow.InputBindings );
_fwList.Add( fwc );
@ -3437,7 +3436,7 @@ namespace Xceed.Wpf.AvalonDock
if( grandParentPaneContainer != null )
{
var children = grandParentPaneContainer.Children.Where( child => ( child.Equals( parentPane ) && ( parentPane is ILayoutContainer ) && ( ( ( ILayoutContainer )parentPane ).ChildrenCount > 1 ) )
|| (!child.Equals( parentPane ) && (child is ILayoutContainer) && (((ILayoutContainer)child).ChildrenCount > 0)) )
|| ( !child.Equals( parentPane ) && ( child is ILayoutContainer ) && ( ( ( ILayoutContainer )child ).ChildrenCount > 0 ) ) )
.Cast<ILayoutPositionableElement>()
.Where( child => child.DockWidth.IsStar );
var childrenTotalWidth = children.Sum( child => child.DockWidth.Value );
@ -3479,7 +3478,7 @@ namespace Xceed.Wpf.AvalonDock
{
if( anchorableContextMenu.PlacementTarget is Control )
{
anchorableContextMenu.VerticalOffset = ( (Control)anchorableContextMenu.PlacementTarget ).ActualHeight - anchorableContextMenu.ActualHeight;
anchorableContextMenu.VerticalOffset = ( ( Control )anchorableContextMenu.PlacementTarget ).ActualHeight - anchorableContextMenu.ActualHeight;
}
this.AnchorableContextMenu.Opened -= this.AnchorableContextMenu_Opened;
}
@ -3623,10 +3622,10 @@ namespace Xceed.Wpf.AvalonDock
{
if( typeof( CollectionChangedEventManager ) == managerType )
{
var args = (NotifyCollectionChangedEventArgs)e;
var args = ( NotifyCollectionChangedEventArgs )e;
if( sender == this.DocumentsSource )
{
this.documentsSourceElementsChanged( sender, args );
this.DocumentsSourceElementsChanged( sender, args );
}
else if( sender == this.AnchorablesSource )
{

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

@ -872,8 +872,6 @@ namespace Xceed.Wpf.AvalonDock.Layout
IsSelected = true;
IsActive = true;
Root.CollectGarbage();
}
else
{
@ -883,6 +881,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
IsActive = true;
}
Root.CollectGarbage();
}
/// <summary>
@ -959,6 +958,7 @@ namespace Xceed.Wpf.AvalonDock.Layout
IsSelected = true;
IsActive = true;
IsFloating = false;
}
else
{

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

@ -34,6 +34,10 @@ namespace Xceed.Wpf.AvalonDock.Layout
public LayoutDocumentPane( LayoutContent firstChild )
{
this.Children.Add( firstChild );
if( this.Root != null )
{
this.Root.CollectGarbage();
}
}
#endregion

13
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Layout/LayoutGroup.cs

@ -140,14 +140,19 @@ namespace Xceed.Wpf.AvalonDock.Layout
public void ReplaceChild( ILayoutElement oldElement, ILayoutElement newElement )
{
int index = _children.IndexOf( ( T )oldElement );
_children.Insert( index, ( T )newElement );
_children.RemoveAt( index + 1 );
var index = _children.IndexOf( ( T )oldElement );
if( index >= 0 )
{
this.ReplaceChildAt( index, newElement );
}
}
public void ReplaceChildAt( int index, ILayoutElement element )
{
_children[ index ] = ( T )element;
if( (index >= 0) && (index < _children.Count) )
{
_children[ index ] = ( T )element;
}
}

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

@ -447,8 +447,11 @@ namespace Xceed.Wpf.AvalonDock.Layout
}
//for each pane that is empty
foreach( var emptyPane in this.Descendents().OfType<ILayoutPane>().Where( p => p.ChildrenCount == 0 ) )
var layoutPanes = this.Descendents().OfType<ILayoutPane>().Where( p => p.ChildrenCount == 0 ).ToArray();
for( int i = 0; i < layoutPanes.Count(); ++i )
{
var emptyPane = layoutPanes[ i ];
//...set null any reference coming from contents not yet hosted in a floating window
foreach( var contentReferencingEmptyPane in this.Descendents().OfType<LayoutContent>()
.Where( c => ( ( ILayoutPreviousContainer )c ).PreviousContainer == emptyPane && !c.IsFloating ) )
@ -464,7 +467,10 @@ namespace Xceed.Wpf.AvalonDock.Layout
//...if this pane is the only documentpane present in the layout than skip it
if( emptyPane is LayoutDocumentPane &&
this.Descendents().OfType<LayoutDocumentPane>().Count( c => c != emptyPane ) == 0 )
{
emptyPane = null;
continue;
}
//...if this empty panes is not referenced by anyone, than removes it from its parent container
if( !this.Descendents().OfType<ILayoutPreviousContainer>().Any( c => c.PreviousContainer == emptyPane )

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.AvalonDock/Themes/Default.xaml

@ -71,7 +71,7 @@
KeyboardNavigation.TabIndex="1"
KeyboardNavigation.DirectionalNavigation="Cycle" />
<avalonDockControls:DropDownButton x:Name="MenuDropDownButton"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1">
<avalonDockControls:DropDownButton.DropDownContextMenu>
@ -374,7 +374,7 @@
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" />
</avalonDockControls:DropDownControlArea>
<avalonDockControls:DropDownButton Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
<avalonDockControls:DropDownButton Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1"
DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
@ -389,7 +389,7 @@
<Button x:Name="PART_AutoHidePin"
Grid.Column="2"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=LayoutItem.AutoHideCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnAutoHide_Hint}">
@ -402,7 +402,7 @@
<Button x:Name="PART_HidePin"
Grid.Column="3"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_Hide}">
@ -747,6 +747,10 @@
<!--DockingManager-->
<Style x:Key="{x:Type avalonDock:DockingManager}"
TargetType="{x:Type avalonDock:DockingManager}">
<Setter Property="Background"
Value="White" />
<Setter Property="Foreground"
Value="Black" />
<Setter Property="DocumentPaneControlStyle"
Value="{StaticResource DocumentPaneControlStyle}" />
<Setter Property="AnchorablePaneControlStyle"
@ -878,7 +882,7 @@
ContentTemplateSelector="{Binding Root.Manager.DocumentHeaderTemplateSelector, Mode=OneWay}" />
<Button x:Name="DocumentCloseButton"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Grid.Column="2"
Visibility="Hidden"
Command="{Binding Path=LayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
@ -1039,7 +1043,7 @@
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
@ -1051,7 +1055,7 @@
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
@ -1062,7 +1066,7 @@
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
@ -1149,7 +1153,7 @@
<avalonDockControls:DropDownButton x:Name="SinglePaneContextMenu"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ToggleButtonStyleKey}}"
Focusable="False"
Grid.Column="1"
DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
@ -1162,7 +1166,7 @@
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
@ -1174,7 +1178,7 @@
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
@ -1186,7 +1190,7 @@
<Button x:Name="CloseButton"
shell:WindowChrome.IsHitTestVisibleInChrome="True"
Focusable="False"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Style="{DynamicResource {x:Static ToolBar.ButtonStyleKey}}"
Command="{Binding HideWindowCommand, RelativeSource={RelativeSource TemplatedParent}}"
ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"

49
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockPropertiesView.xaml.cs.txt

@ -0,0 +1,49 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System;
using System.Windows;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views
{
/// <summary>
/// Interaction logic for DockingManagerPropertiesView.xaml
/// </summary>
public partial class AvalonDockPropertiesView : DemoView
{
public AvalonDockPropertiesView()
{
InitializeComponent();
}
}
public class GenericResourceDictionary : ResourceDictionary
{
public GenericResourceDictionary()
{
this.Source = new Uri( @"/" +
#if NET5
"Xceed.Wpf.AvalonDock.NET5" +
#elif NETCORE
"Xceed.Wpf.AvalonDock.NETCore" +
#else
"Xceed.Wpf.AvalonDock" +
#endif
";component/Themes/generic.xaml", UriKind.Relative );
}
}
}

664
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockPropertiesView.xaml.txt

@ -0,0 +1,664 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views.AvalonDockPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:localView="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views"
Title="DockingManager Properties">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
The DockingManager is the core control of AvalonDock. The class provides several "Template" properties (e.g., AnchorableTitleTemplate/DocumentTitleTemplate, AnchorableHeaderTemplate/DocumentHeaderTemplate, etc.) that allow designers and developers to specify the template for the elements contained in the layout.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<localView:GenericResourceDictionary />
</ResourceDictionary.MergedDictionaries>
<xcad:LayoutRoot x:Key="DefaultLayout" x:Name="layoutRoot1">
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePane DockWidth="160">
<xcad:LayoutAnchorable ContentId="properties"
Title="Properties"
CanHide="False"
CanClose="False"
AutoHideWidth="240"
IconSource="../Images/property-blue.png">
<xctk:PropertyGrid x:Name="propertyGrid"
NameColumnWidth="110"
AutoGenerateProperties="False">
</xctk:PropertyGrid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="document1"
Title="Document 1"
IconSource="../Images/document.png">
<Button Content="Document 1 Content"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</xcad:LayoutDocument>
<xcad:LayoutDocument ContentId="document2"
Title="Document 2"
IconSource="../Images/document.png">
<TextBox Text="Document 2 Content"
AcceptsReturn="True" />
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup >
<xcad:LayoutAnchorablePaneGroup DockWidth="125">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable ContentId="alarms"
Title="Alarms"
IconSource="../Images/alarm-clock-blue.png"
CanClose="True">
<ListBox>
<s:String>Alarm 1</s:String>
<s:String>Alarm 2</s:String>
<s:String>Alarm 3</s:String>
</ListBox>
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable ContentId="journal"
Title="Journal">
<RichTextBox>
<FlowDocument>
<Paragraph FontSize="14"
FontFamily="Segoe">
This is the content of the Journal Pane.
<LineBreak />
A
<Bold>RichTextBox</Bold> has been added here
</Paragraph>
</FlowDocument>
</RichTextBox>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
</xcad:LayoutPanel>
<xcad:LayoutRoot.LeftSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Agenda"
ContentId="agenda"
IconSource="../Images/address-book-open.png">
<TextBlock Text="Agenda Content"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable Title="Contacts"
ContentId="contacts"
IconSource="../Images/address-book--pencil.png">
<TextBlock Text="Contacts Content"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.LeftSide>
</xcad:LayoutRoot>
<xcad:LayoutRoot x:Key="CustomLayout" x:Name="layoutRoot2">
<xcad:LayoutPanel x:Name="layoutPanel" Orientation="Horizontal">
<xcad:LayoutAnchorablePane DockWidth="200">
<xcad:LayoutAnchorable ContentId="explorer"
Title="Explorer"
CanHide="False"
CanClose="False"
AutoHideWidth="240"
IconSource="../Images/property-blue.png">
<TreeView>
<TreeViewItem Header="Level 1" IsExpanded="True">
<TreeViewItem Header="Level 2.1" />
<TreeViewItem Header="Level 2.2" IsExpanded="True">
<TreeViewItem Header="Level 3.1" />
<TreeViewItem Header="Level 3.2" />
</TreeViewItem>
<TreeViewItem Header="Level 2.3" />
</TreeViewItem>
</TreeView>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutDocumentPaneGroup Orientation="Horizontal">
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="docs" Title="Documents" >
<TextBox>Simple text doc.</TextBox>
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="files" Title="Files" >
<DockPanel Margin="10">
<WrapPanel HorizontalAlignment="Center" DockPanel.Dock="Top" Margin="0,0,0,10">
<Button x:Name="OpenFile">Open files</Button>
</WrapPanel>
<ListBox Name="lbFiles">
<TextBox>File 1</TextBox>
<TextBox>File 2</TextBox>
<TextBox>File 3</TextBox>
</ListBox>
</DockPanel>
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup >
</xcad:LayoutPanel>
<xcad:LayoutRoot.RightSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Options"
ContentId="options">
<TextBlock Text="Options"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable Title="Tools"
ContentId="Tools">
<TextBlock Text="Items"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.RightSide>
</xcad:LayoutRoot>
<Style x:Key="DefaultDocumentPaneControlStyle"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="DocumentPaneControlStyle1"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="LightSlateGray" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xcad:LayoutDocumentPaneControl}">
<Grid>
<TabControl x:Name="leftMaterialTabs"
TabStripPlacement="Left">
<TabItem Header="First"
VerticalContentAlignment="Center"
Content="MaterialTabItem #1" />
<TabItem Header="Second"
VerticalContentAlignment="Center"
Content="MaterialTabItem #2" />
<TabItem Header="Third"
VerticalContentAlignment="Center"
Content="MaterialTabItem #3" />
<TabItem Header="Fourth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #4" />
<TabItem Header="Fifth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #5" />
</TabControl>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DocumentPaneControlStyle2"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="DarkGray" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Model.ChildrenCount}"
Value="0">
<!-- New template when no more LayoutDocument in LayoutDocumentPane -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xcad:LayoutDocumentPaneControl}">
<Grid>
<Button Content="Button"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="DefaultAnchorSideTemplate"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="{TemplateBinding Background}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="AnchorSideTemplate1"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="LightCyan">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="AnchorSideTemplate2"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="Beige" BorderThickness="2">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="DefaultAnchorTemplate"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="AnchorTemplate1"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="BlueViolet"
BorderThickness="2"
CornerRadius="1"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="AnchorTemplate2"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="Black"
BorderThickness="4"
CornerRadius="3"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"
Width="32"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Beige" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<DataTemplate x:Key="DefaultDocumentHeaderTemplate">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}"
TextTrimming="WordEllipsis" />
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="DocumentHeaderTemplate1">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="SlateGray"/>
</Setter.Value>
</Setter>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="DocumentHeaderTemplate2">
<StackPanel Orientation="Horizontal">
<Border Background="Blue" Margin="5,4" />
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="OrangeRed"/>
</Setter.Value>
</Setter>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</DataTemplate>
<ContextMenu x:Key="DefaultDocumentContextMenu">
<MenuItem Header="{x:Static xcad:Resources.Document_Close}"
Command="{Binding Path=CloseCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_CloseAllButThis}"
Command="{Binding Path=CloseAllButThisCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_CloseAll}"
Command="{Binding Path=CloseAllCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_Float}"
Command="{Binding Path=FloatCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_DockAsDocument}"
Command="{Binding Path=DockAsDocumentCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_NewHorizontalTabGroup}"
Command="{Binding Path=NewHorizontalTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_NewVerticalTabGroup}"
Command="{Binding Path=NewVerticalTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_MoveToNextTabGroup}"
Command="{Binding Path=MoveToNextTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_MoveToPreviousTabGroup}"
Command="{Binding Path=MoveToPreviousTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
</ContextMenu>
<ContextMenu x:Key="DocumentContextMenu1">
<MenuItem Header="Menu item 1" />
<MenuItem Header="Menu item 2" />
<Separator />
<MenuItem Header="Menu item 3" />
</ContextMenu>
<ContextMenu x:Key="DocumentContextMenu2">
<MenuItem Header="Option 1" />
<MenuItem Header="Option 2" />
<Separator />
<MenuItem Header="Option 3" />
<MenuItem Header="Option 4" />
</ContextMenu>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Layout: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding Layout, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different layout panes in the DockingManager.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultLayout}" />
<ComboBoxItem Content="Template 1"
Tag="{StaticResource CustomLayout}" />
</ComboBox>
<TextBlock Text="DocumentPaneControlStyle: "
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="0" />
<ComboBox Grid.Column="1"
Grid.Row="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding DocumentPaneControlStyle, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different document pane styles in the DockingManager.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentPaneControlStyle}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentPaneControlStyle1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentPaneControlStyle2}" />
</ComboBox>
<TextBlock Text="AnchorSideTemplate: "
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="0" />
<ComboBox Grid.Row="2"
Grid.Column="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding AnchorSideTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Sets the ControlTemplate to use to render LayoutAnchorSideControl.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultAnchorSideTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource AnchorSideTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource AnchorSideTemplate2}" />
</ComboBox>
<TextBlock Text="DocumentContextMenu:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="0" />
<ComboBox Grid.Row="3"
Grid.Column="1"
Margin="5"
Width="120"
VerticalAlignment="Center"
SelectedValue="{Binding DocumentContextMenu, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Sets different context menus to show for documents.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentContextMenu}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentContextMenu1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentContextMenu2}" />
</ComboBox>
<!--2nd column-->
<TextBlock Text="AnchorTemplate: "
VerticalAlignment="Center"
Grid.Row="0"
Grid.Column="2"
Margin="40,0,0,0"/>
<ComboBox Grid.Column="3"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding AnchorTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different ControlTemplate for LayoutAnchorControl.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultAnchorTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource AnchorTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource AnchorTemplate2}" />
</ComboBox>
<TextBlock Text="DocumentHeaderTemplate: "
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="2"
Margin="40,0,0,0" />
<ComboBox Grid.Row="1"
Grid.Column="3"
VerticalAlignment="Center"
Margin="5"
Width="120"
SelectedValue="{Binding DocumentHeaderTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different data template to use for document headers.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentHeaderTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentHeaderTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentHeaderTemplate2}" />
</ComboBox>
<TextBlock Text="AutoHideWindowClosingTimer:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="2"
Margin="40,0,0,0"/>
<xctk:IntegerUpDown x:Name="_integerUpDown"
Grid.Row="2"
Grid.Column="3"
VerticalAlignment="Center"
Margin="5"
Width="120"
Value="{Binding AutoHideWindowClosingTimer, ElementName=_dockingManager, ValidatesOnExceptions=True}"
ToolTip="Set the time (in ms, ex: 2000, 3000, 6000) it will take to close the AutoHideWindow (Agenda/Contacts) when not moused over or active."/>
<TextBlock Text="AllowMixedOrientation:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="2"
Margin="40,0,0,0" />
<CheckBox Grid.Row="3"
Grid.Column="3"
Width="120"
IsChecked="{Binding AllowMixedOrientation, ElementName=_dockingManager}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Sets whether the docking manager should allow mixed orientation for document panes." />
</Grid>
</GroupBox>
<Grid Grid.Row="1"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Grid.Row="1">
<xcad:DockingManager x:Name="_dockingManager"
Height="300"
MaxHeight="395"
Layout="{StaticResource DefaultLayout}"
DocumentPaneControlStyle="{StaticResource DefaultDocumentPaneControlStyle}"
AnchorSideTemplate="{StaticResource DefaultAnchorSideTemplate}"
AnchorTemplate="{StaticResource DefaultAnchorTemplate}"
DocumentHeaderTemplate="{StaticResource DefaultDocumentHeaderTemplate}"
AutoHideWindowClosingTimer="1000"
DocumentContextMenu="{StaticResource DefaultDocumentContextMenu}"
BorderBrush="Black"
BorderThickness="1"
AllowMixedOrientation="True">
</xcad:DockingManager>
</StackPanel>
</Grid>
</Grid>
</local:DemoView>

117
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockSourcesView.xaml.cs.txt

@ -0,0 +1,117 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Xceed.Wpf.AvalonDock.Layout;
using Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views
{
/// <summary>
/// Interaction logic for AvalonDockSourcesView.xaml
/// </summary>
public partial class AvalonDockSourcesView : DemoView
{
public AvalonDockSourcesView()
{
InitializeComponent();
this.Documents = new ObservableCollection<DocumentBase>()
{
new Resources.Page(){ Title = "Page" },
new Resources.Document(){ Title = "Document" },
new Resources.Note(){ Title = "Notes" },
};
this.Anchorables = new ObservableCollection<Control>()
{
new Label() { Content = "Tools" },
new Label() { Content = "Settings" }
};
this.DataContext = this;
}
public ObservableCollection<DocumentBase> Documents
{
get; private set;
}
public ObservableCollection<Control> Anchorables
{
get; private set;
}
}
// Custom LayoutUpdateStrategy class to call when AvalonDock needs to position an anchorable or a document inside an existing layout model.
public class LayoutManager : ILayoutUpdateStrategy
{
// Performs actions before an anchorable is to be inserted.
public bool BeforeInsertAnchorable( LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer )
{
return false;
}
// Performs actions after an anchorable has been inserted.
public void AfterInsertAnchorable( LayoutRoot layout, LayoutAnchorable anchorableShown )
{
}
// Performs actions before a document is to be inserted.
public bool BeforeInsertDocument( LayoutRoot layout, LayoutDocument documentToShow, ILayoutContainer destinationContainer )
{
var documentPanes = layout.Descendents().OfType<LayoutDocumentPane>().ToList();
if( documentPanes.Count > 0 )
documentPanes[ 0 ].Children.Add( documentToShow );
return true;
}
// Performs actions after a document has been inserted.
public void AfterInsertDocument( LayoutRoot layout, LayoutDocument anchorableShown )
{
}
}
// StyleSelector Class that allows to apply a Style for a LayoutDocument/LayoutAnchorable.
public class ContainerStyleSelector : StyleSelector
{
public Style LayoutItemStyle
{
get; set;
}
public Style LayoutAnchorableItemStyle
{
get; set;
}
public override System.Windows.Style SelectStyle( object item, System.Windows.DependencyObject container )
{
if( item is Label )
return LayoutAnchorableItemStyle;
if( item is DocumentBase )
return LayoutItemStyle;
return base.SelectStyle( item, container );
}
}
}

102
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/AvalonDockSourcesView.xaml.txt

@ -0,0 +1,102 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views.AvalonDockSourcesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:localView="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views"
xmlns:views="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
mc:Ignorable="d"
Title="Sources">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>DocumentsSource/AnchorablesSource properties allows you to bind the DockingManager to a collection source from XAML.</Run>
<LineBreak />
<Run>ILayoutUpdateStrategy is mainly used to modify or position a LayoutContent when DockingManager.DocumentsSource/AnchorablesSource changes.</Run>
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<DataTemplate DataType="{x:Type views:Page}">
<views:PageView />
</DataTemplate>
<DataTemplate DataType="{x:Type views:Document}">
<views:DocumentView />
</DataTemplate>
<DataTemplate DataType="{x:Type views:Note}">
<views:NoteView />
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Grid.Row="1">
<xcad:DockingManager x:Name="_dockingManager"
DocumentsSource="{Binding Documents}"
AnchorablesSource="{Binding Anchorables}"
Height="350"
MaxHeight="450"
AllowMixedOrientation="True"
BorderBrush="Black"
BorderThickness="1">
<xcad:DockingManager.LayoutUpdateStrategy>
<localView:LayoutManager />
</xcad:DockingManager.LayoutUpdateStrategy>
<xcad:DockingManager.LayoutItemContainerStyleSelector>
<localView:ContainerStyleSelector>
<!-- StyleSelector that defines a Style for a LayoutDocument. This defines the LayoutDocument title according to the DocumentBase Title property.-->
<localView:ContainerStyleSelector.LayoutItemStyle>
<Style TargetType="{x:Type xcad:LayoutItem}">
<Setter Property="Title" Value="{Binding Model.Title}" />
</Style>
</localView:ContainerStyleSelector.LayoutItemStyle>
<!-- StyleSelector that defines a Style for a LayoutAnchorable. This defines the LayoutAnchorable title according to the Control content property.-->
<localView:ContainerStyleSelector.LayoutAnchorableItemStyle>
<Style TargetType="{x:Type xcad:LayoutAnchorableItem}">
<Setter Property="Title" Value="{Binding Model.Content}" />
<Setter Property="ContentId" Value="{Binding Model.Content}" />
</Style>
</localView:ContainerStyleSelector.LayoutAnchorableItemStyle>
</localView:ContainerStyleSelector>
</xcad:DockingManager.LayoutItemContainerStyleSelector>
</xcad:DockingManager>
</StackPanel>
</Grid>
</local:DemoView>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ButtonSpinnerView.xaml.txt

@ -62,8 +62,8 @@
<TextBlock Text="AllowSpin:" VerticalAlignment="Center" />
<CheckBox x:Name="_allowSpin" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="When true allows the ButtonSpinner to perform increment/decrement operations." />
<TextBlock Text="ShowButtonSpinner:" VerticalAlignment="Center" Grid.Row="1" />
<CheckBox x:Name="_showButtonSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." />
<TextBlock Text="ShowSpinner:" VerticalAlignment="Center" Grid.Row="1" />
<CheckBox x:Name="_showSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." />
</Grid>
</GroupBox>
@ -76,7 +76,7 @@
Width="150"
HorizontalAlignment="Left"
AllowSpin="{Binding IsChecked, ElementName=_allowSpin}"
ShowButtonSpinner="{Binding IsChecked, ElementName=_showButtonSpinner}"
ShowSpinner="{Binding IsChecked, ElementName=_showSpinner}"
Spin="ButtonSpinner_Spin">
<TextBox Text="John Smith" IsReadOnly="True" BorderThickness="0" HorizontalContentAlignment="Right" />
</xctk:ButtonSpinner>

76
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAdvancedContextMenuView.xaml.cs.txt

@ -0,0 +1,76 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{
/// <summary>
/// Interaction logic for PropertyGridAdvancedContextMenuView.xaml
/// </summary>
public partial class PropertyGridAdvancedContextMenuView : DemoView
{
public PropertyGridAdvancedContextMenuView()
{
InitializeComponent();
var selObject = new Person()
{
FirstName = "John",
LastName = "Doe"
};
this.DataContext = selObject;
}
private void MenuItem_Click( object sender, RoutedEventArgs e )
{
MenuItem menuItem = sender as MenuItem;
if( menuItem != null && menuItem.DataContext is PropertyItem )
{
Clipboard.SetData( DataFormats.Text, ( ( PropertyItem )menuItem.DataContext ).Value );
}
}
private class Person
{
public string FirstName
{
get; set;
}
public string LastName
{
get; set;
}
}
}
}

38
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridAdvancedContextMenuView.xaml.txt

@ -0,0 +1,38 @@
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridAdvancedContextMenuView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="Advanced ContextMenu"
VerticalScrollBarVisibility="Disabled">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
By default the propertyGrid provides a context menu for all the properties for a given object. You can override this behavior by setting the ShowAdvancedOptions property to True, and then use the AdvancedOptionsMenu property to provide a custom context menu for the properties.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<xctk:PropertyGridContextMenu x:Key="AdvancedOptionsMenu">
<MenuItem Header="Copy"
Click="MenuItem_Click" />
</xctk:PropertyGridContextMenu>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<xctk:PropertyGrid x:Name="_propertyGrid"
Width="450"
MaxHeight="245"
Margin="10"
ShowAdvancedOptions="True"
SelectedObject="{Binding}"
AdvancedOptionsMenu="{StaticResource AdvancedOptionsMenu}">
</xctk:PropertyGrid>
</Grid>
</local:DemoView>

52
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs.txt

@ -0,0 +1,52 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{
/// <summary>
/// Interaction logic for PropertyGridEditorComboBoxDefinitionSourceView.xaml
/// </summary>
public partial class PropertyGridEditorComboBoxDefinitionSourceView : DemoView
{
public PropertyGridEditorComboBoxDefinitionSourceView()
{
InitializeComponent();
}
}
}

45
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridEditorComboBoxDefinitionSourceView.xaml.txt

@ -0,0 +1,45 @@
<!--**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridEditorComboBoxDefinitionSourceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="PropertyGrid EditorComboBoxDefinition Source" Height="450" Width="800">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
When using the PropertyGrid EditorComboBoxDefinition, you can bind its ItemsSource to a non-static collection source.
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
<Image Source="..\OpenSourceImages\EditorComboBoxDefinition.png" Width="660" Height="430"/>
</local:DemoView>

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.cs.txt

@ -15,13 +15,6 @@
************************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using System.Linq;
using System.Collections.ObjectModel;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
using Xceed.Wpf.Toolkit.PropertyGrid;

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/PropertyGridPropertyItemStyleView.xaml.txt

@ -54,7 +54,7 @@
PreparePropertyItem="OnPreparePropertyItem">
<xctk:PropertyGrid.PropertyContainerStyle>
<!--This style will be set to all PropertyItem instances (direct and expanded) in the property grid. -->
<Style TargetType="{x:Type xctk:PropertyItemBase}">
<Style TargetType="{x:Type xctk:PropertyItem}" BasedOn="{StaticResource {x:Type xctk:PropertyItem}}">
<Setter Property="Foreground" Value="Red" />
</Style>
</xctk:PropertyGrid.PropertyContainerStyle>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingAvalonDockView.xaml.txt

@ -27,7 +27,11 @@
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>Changes the themes of the AvalonDock controls. Available themes are System, HighContrast, Aero, VS2010, Metro, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the AvalonDock controls. Available themes are System, HighContrast, Aero, VS2010, Metro, Office2007, Windows10, MaterialDesign(Plus only) and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>Some features of this sample are only available in the "Plus" version.</Run>
<LineBreak />

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingCoreWPFView.xaml.txt

@ -25,7 +25,11 @@
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the WPF controls. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Themes.Office2007.dll or Xceed.Wpf.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the WPF controls. Available themes are System, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.Themes.Office2007.dll, Xceed.Wpf.Themes.Windows10.dll, Xceed.Wpf.Themes.MaterialDesign.dll, Xceed.Wpf.Themes.MaterialDesignColors.dll or Xceed.Wpf.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingDataGridView.xaml.txt

@ -27,7 +27,11 @@
x:Name="_demo">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the datagrid control. Available themes are System, HighContrast, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the datagrid control. Available themes are System, HighContrast, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.DataGrid.Themes.Office2007.dll, Xceed.Wpf.DataGrid.Themes.Windows10.dll, Xceed.Wpf.DataGrid.Themes.MaterialDesign.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.cs.txt

@ -21,6 +21,7 @@ using System;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Documents;
using Microsoft.Win32;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingExtendedToolkitView.xaml.txt

@ -23,17 +23,22 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="Theming Toolkit Plus For WPF"
x:Name="_demo">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, HighContrast, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run>
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, HighContrast, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll, Xceed.Wpf.Toolkit.Themes.MaterialDesign.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
</Paragraph>
</local:DemoView.Description>

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/ThemingListBoxView.xaml.txt

@ -30,7 +30,11 @@
<Run>Dress Up Your App in Style in Minutes</Run>
<LineBreak />
<LineBreak />
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, HighContrast, Office2007, LiveExplorer, MediaPlayer, Windows10 and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, HighContrast, Office2007, LiveExplorer, MediaPlayer, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

27
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/CodeFiles/TimeSpanView.xaml.txt

@ -29,16 +29,6 @@
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ObjectDataProvider x:Key="enumDateTimePart"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -119,10 +109,21 @@
<ComboBox x:Name="_currentDateTimePart"
Grid.Row="5"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource enumDateTimePart}}"
SelectedItem="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
SelectedValue="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
SelectedValuePath="Tag"
Margin="5,5,25,5"
ToolTip="Must match a DateTimePart of the TimeSpanUpDown" />
ToolTip="Must match a DateTimePart of the TimeSpanUpDown" >
<ComboBoxItem Content="Day"
Tag="{x:Static xctk:DateTimePart.Day}" />
<ComboBoxItem Content="Hour24"
Tag="{x:Static xctk:DateTimePart.Hour24}" />
<ComboBoxItem Content="Minute"
Tag="{x:Static xctk:DateTimePart.Minute}" />
<ComboBoxItem Content="Second"
Tag="{x:Static xctk:DateTimePart.Second}" />
<ComboBoxItem Content="Millisecond"
Tag="{x:Static xctk:DateTimePart.Millisecond}" />
</ComboBox>
<!-- 2nd column-->
<TextBlock Grid.Column="2"

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/MainWindow.xaml

@ -471,6 +471,9 @@
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridDefaultEditorsView}" />
<core:LiveExplorerTreeViewItem Header="EditorTemplateDefinition"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridCustomEditorsView}" />
<core:LiveExplorerTreeViewItem Header="EditorDefinition Source"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridEditorComboBoxDefinitionSourceView}"
IsPlusOnlyFeature="True" />
<core:LiveExplorerTreeViewItem Header="More EditorDefinitions..."
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridEditorDefinitionsView}"
IsPlusOnlyFeature="True" />
@ -513,6 +516,9 @@
<core:LiveExplorerTreeViewItem Header="Customizing PropertyItems"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridPropertyItemStyleView}"
Style="{StaticResource TreeViewItemStyle}" />
<core:LiveExplorerTreeViewItem Header="Advanced ContextMenu"
SampleType="{x:Type samples:PropertyGrid.Views.PropertyGridAdvancedContextMenuView}"
Style="{StaticResource TreeViewItemStyle}" />
</core:LiveExplorerTreeViewItem>
<core:LiveExplorerTreeViewItem Header="DataGrid"
@ -688,7 +694,15 @@
Style="{StaticResource TreeViewHeaderStyle}"
ItemContainerStyle="{StaticResource TreeViewItemStyle}">
<core:LiveExplorerTreeViewItem Header="AvalonDock"
SampleType="{x:Type samples:AvalonDock.Views.AvalonDockView}" />
Style="{StaticResource TreeViewHeaderStyle}"
ItemContainerStyle="{StaticResource TreeViewItemStyle}"
SampleType="{x:Type samples:AvalonDock.Views.AvalonDockView}"
IsExpanded="True">
<core:LiveExplorerTreeViewItem Header="Properties"
SampleType="{x:Type samples:AvalonDock.Views.AvalonDockPropertiesView}" />
<core:LiveExplorerTreeViewItem Header="Sources"
SampleType="{x:Type samples:AvalonDock.Views.AvalonDockSourcesView}" />
</core:LiveExplorerTreeViewItem>
<core:LiveExplorerTreeViewItem Header="Magnifier"
SampleType="{x:Type samples:Magnifier.Views.MagnifierView}" />
<core:LiveExplorerTreeViewItem Header="Pie"

2
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.2" )]
[assembly: AssemblyVersion( "4.3" )]
#pragma warning disable 1699
[assembly: AssemblyDelaySign( false )]

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Document.cs

@ -0,0 +1,28 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
public class Document : DocumentBase
{
public Document()
{
}
}
}

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentBase.cs

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
public class DocumentBase
{
public string Title
{
get; set;
}
}
}

46
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentView.xaml

@ -0,0 +1,46 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<UserControl x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources.DocumentView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<xcad:DockingManager x:Name="_dockingManager"
AllowMixedOrientation="True">
<xcad:LayoutRoot x:Name="_layoutRoot">
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="documentA" Title="Document A">
<TextBlock Text="document A content" HorizontalAlignment="Center" VerticalAlignment="Center" />
</xcad:LayoutDocument>
<xcad:LayoutDocument ContentId="documenB" Title="Document B">
<TextBlock Text="document B content" HorizontalAlignment="Center" VerticalAlignment="Center" />
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup >
</xcad:LayoutPanel>
</xcad:LayoutRoot>
</xcad:DockingManager>
</Grid>
</UserControl>

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/DocumentView.xaml.cs

@ -0,0 +1,32 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System.Windows.Controls;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
/// <summary>
/// Interaction logic for DocumentView.xaml
/// </summary>
public partial class DocumentView : UserControl
{
public DocumentView()
{
InitializeComponent();
}
}
}

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Note.cs

@ -0,0 +1,28 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
public class Note : DocumentBase
{
public Note()
{
}
}
}

31
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/NoteView.xaml

@ -0,0 +1,31 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<UserControl x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources.NoteView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBox HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Text="Note content goes here..." />
</Grid>
</UserControl>

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/NoteView.xaml.cs

@ -0,0 +1,32 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System.Windows.Controls;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
/// <summary>
/// Interaction logic for NoteView.xaml
/// </summary>
public partial class NoteView : UserControl
{
public NoteView()
{
InitializeComponent();
}
}
}

28
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/Page.cs

@ -0,0 +1,28 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
public class Page : DocumentBase
{
public Page()
{
}
}
}

31
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/PageView.xaml

@ -0,0 +1,31 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<UserControl x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources.PageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Label Content="Content goes here..."
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
</Grid>
</UserControl>

32
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Resources/PageView.xaml.cs

@ -0,0 +1,32 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System.Windows.Controls;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources
{
/// <summary>
/// Interaction logic for PageView.xaml
/// </summary>
public partial class PageView : UserControl
{
public PageView()
{
InitializeComponent();
}
}
}

664
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockPropertiesView.xaml

@ -0,0 +1,664 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views.AvalonDockPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:localView="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views"
Title="DockingManager Properties">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
The DockingManager is the core control of AvalonDock. The class provides several "Template" properties (e.g., AnchorableTitleTemplate/DocumentTitleTemplate, AnchorableHeaderTemplate/DocumentHeaderTemplate, etc.) that allow designers and developers to specify the template for the elements contained in the layout.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<localView:GenericResourceDictionary />
</ResourceDictionary.MergedDictionaries>
<xcad:LayoutRoot x:Key="DefaultLayout" x:Name="layoutRoot1">
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePane DockWidth="160">
<xcad:LayoutAnchorable ContentId="properties"
Title="Properties"
CanHide="False"
CanClose="False"
AutoHideWidth="240"
IconSource="../Images/property-blue.png">
<xctk:PropertyGrid x:Name="propertyGrid"
NameColumnWidth="110"
AutoGenerateProperties="False">
</xctk:PropertyGrid>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="document1"
Title="Document 1"
IconSource="../Images/document.png">
<Button Content="Document 1 Content"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</xcad:LayoutDocument>
<xcad:LayoutDocument ContentId="document2"
Title="Document 2"
IconSource="../Images/document.png">
<TextBox Text="Document 2 Content"
AcceptsReturn="True" />
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup >
<xcad:LayoutAnchorablePaneGroup DockWidth="125">
<xcad:LayoutAnchorablePane>
<xcad:LayoutAnchorable ContentId="alarms"
Title="Alarms"
IconSource="../Images/alarm-clock-blue.png"
CanClose="True">
<ListBox>
<s:String>Alarm 1</s:String>
<s:String>Alarm 2</s:String>
<s:String>Alarm 3</s:String>
</ListBox>
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable ContentId="journal"
Title="Journal">
<RichTextBox>
<FlowDocument>
<Paragraph FontSize="14"
FontFamily="Segoe">
This is the content of the Journal Pane.
<LineBreak />
A
<Bold>RichTextBox</Bold> has been added here
</Paragraph>
</FlowDocument>
</RichTextBox>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutAnchorablePaneGroup>
</xcad:LayoutPanel>
<xcad:LayoutRoot.LeftSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Agenda"
ContentId="agenda"
IconSource="../Images/address-book-open.png">
<TextBlock Text="Agenda Content"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable Title="Contacts"
ContentId="contacts"
IconSource="../Images/address-book--pencil.png">
<TextBlock Text="Contacts Content"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.LeftSide>
</xcad:LayoutRoot>
<xcad:LayoutRoot x:Key="CustomLayout" x:Name="layoutRoot2">
<xcad:LayoutPanel x:Name="layoutPanel" Orientation="Horizontal">
<xcad:LayoutAnchorablePane DockWidth="200">
<xcad:LayoutAnchorable ContentId="explorer"
Title="Explorer"
CanHide="False"
CanClose="False"
AutoHideWidth="240"
IconSource="../Images/property-blue.png">
<TreeView>
<TreeViewItem Header="Level 1" IsExpanded="True">
<TreeViewItem Header="Level 2.1" />
<TreeViewItem Header="Level 2.2" IsExpanded="True">
<TreeViewItem Header="Level 3.1" />
<TreeViewItem Header="Level 3.2" />
</TreeViewItem>
<TreeViewItem Header="Level 2.3" />
</TreeViewItem>
</TreeView>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
<xcad:LayoutDocumentPaneGroup Orientation="Horizontal">
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="docs" Title="Documents" >
<TextBox>Simple text doc.</TextBox>
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
<xcad:LayoutDocumentPane>
<xcad:LayoutDocument ContentId="files" Title="Files" >
<DockPanel Margin="10">
<WrapPanel HorizontalAlignment="Center" DockPanel.Dock="Top" Margin="0,0,0,10">
<Button x:Name="OpenFile">Open files</Button>
</WrapPanel>
<ListBox Name="lbFiles">
<TextBox>File 1</TextBox>
<TextBox>File 2</TextBox>
<TextBox>File 3</TextBox>
</ListBox>
</DockPanel>
</xcad:LayoutDocument>
</xcad:LayoutDocumentPane>
</xcad:LayoutDocumentPaneGroup >
</xcad:LayoutPanel>
<xcad:LayoutRoot.RightSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Options"
ContentId="options">
<TextBlock Text="Options"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
<xcad:LayoutAnchorable Title="Tools"
ContentId="Tools">
<TextBlock Text="Items"
Margin="10"
FontSize="18"
FontWeight="Black"
TextWrapping="Wrap" />
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.RightSide>
</xcad:LayoutRoot>
<Style x:Key="DefaultDocumentPaneControlStyle"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="DocumentPaneControlStyle1"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="LightSlateGray" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xcad:LayoutDocumentPaneControl}">
<Grid>
<TabControl x:Name="leftMaterialTabs"
TabStripPlacement="Left">
<TabItem Header="First"
VerticalContentAlignment="Center"
Content="MaterialTabItem #1" />
<TabItem Header="Second"
VerticalContentAlignment="Center"
Content="MaterialTabItem #2" />
<TabItem Header="Third"
VerticalContentAlignment="Center"
Content="MaterialTabItem #3" />
<TabItem Header="Fourth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #4" />
<TabItem Header="Fifth"
VerticalContentAlignment="Center"
Content="MaterialTabItem #5" />
</TabControl>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DocumentPaneControlStyle2"
TargetType="{x:Type xcad:LayoutDocumentPaneControl}"
BasedOn="{StaticResource DocumentPaneControlStyle}">
<Setter Property="Background" Value="DarkGray" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Model.ChildrenCount}"
Value="0">
<!-- New template when no more LayoutDocument in LayoutDocumentPane -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type xcad:LayoutDocumentPaneControl}">
<Grid>
<Button Content="Button"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="DefaultAnchorSideTemplate"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="{TemplateBinding Background}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="AnchorSideTemplate1"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="LightCyan">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="AnchorSideTemplate2"
TargetType="{x:Type xcad:LayoutAnchorSideControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
Background="Beige" BorderThickness="2">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type xcad:LayoutAnchorSideControl}, Mode=FindAncestor}}" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ControlTemplate>
<ControlTemplate x:Key="DefaultAnchorTemplate"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="AnchorTemplate1"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="BlueViolet"
BorderThickness="2"
CornerRadius="1"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Gray" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="AnchorTemplate2"
TargetType="{x:Type xcad:LayoutAnchorControl}">
<Border Cursor="Hand"
BorderBrush="Black"
BorderThickness="4"
CornerRadius="3"
Background="{TemplateBinding Background}">
<ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding Model.Root.Manager.AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3"
Width="32"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Beige" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<DataTemplate x:Key="DefaultDocumentHeaderTemplate">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}"
TextTrimming="WordEllipsis" />
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="DocumentHeaderTemplate1">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="SlateGray"/>
</Setter.Value>
</Setter>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="DocumentHeaderTemplate2">
<StackPanel Orientation="Horizontal">
<Border Background="Blue" Margin="5,4" />
<Image Source="{Binding IconSource}"
Margin="0,0,4,0" />
<TextBlock Text="{Binding Title}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="OrangeRed"/>
</Setter.Value>
</Setter>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</DataTemplate>
<ContextMenu x:Key="DefaultDocumentContextMenu">
<MenuItem Header="{x:Static xcad:Resources.Document_Close}"
Command="{Binding Path=CloseCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_CloseAllButThis}"
Command="{Binding Path=CloseAllButThisCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_CloseAll}"
Command="{Binding Path=CloseAllCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_Float}"
Command="{Binding Path=FloatCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_DockAsDocument}"
Command="{Binding Path=DockAsDocumentCommand}" />
<MenuItem Header="{x:Static xcad:Resources.Document_NewHorizontalTabGroup}"
Command="{Binding Path=NewHorizontalTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_NewVerticalTabGroup}"
Command="{Binding Path=NewVerticalTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_MoveToNextTabGroup}"
Command="{Binding Path=MoveToNextTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<MenuItem Header="{x:Static xcad:Resources.Document_MoveToPreviousTabGroup}"
Command="{Binding Path=MoveToPreviousTabGroupCommand}"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
</ContextMenu>
<ContextMenu x:Key="DocumentContextMenu1">
<MenuItem Header="Menu item 1" />
<MenuItem Header="Menu item 2" />
<Separator />
<MenuItem Header="Menu item 3" />
</ContextMenu>
<ContextMenu x:Key="DocumentContextMenu2">
<MenuItem Header="Option 1" />
<MenuItem Header="Option 2" />
<Separator />
<MenuItem Header="Option 3" />
<MenuItem Header="Option 4" />
</ContextMenu>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Layout: "
VerticalAlignment="Center" />
<ComboBox Grid.Column="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding Layout, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different layout panes in the DockingManager.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultLayout}" />
<ComboBoxItem Content="Template 1"
Tag="{StaticResource CustomLayout}" />
</ComboBox>
<TextBlock Text="DocumentPaneControlStyle: "
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="0" />
<ComboBox Grid.Column="1"
Grid.Row="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding DocumentPaneControlStyle, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different document pane styles in the DockingManager.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentPaneControlStyle}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentPaneControlStyle1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentPaneControlStyle2}" />
</ComboBox>
<TextBlock Text="AnchorSideTemplate: "
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="0" />
<ComboBox Grid.Row="2"
Grid.Column="1"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding AnchorSideTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Sets the ControlTemplate to use to render LayoutAnchorSideControl.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultAnchorSideTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource AnchorSideTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource AnchorSideTemplate2}" />
</ComboBox>
<TextBlock Text="DocumentContextMenu:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="0" />
<ComboBox Grid.Row="3"
Grid.Column="1"
Margin="5"
Width="120"
VerticalAlignment="Center"
SelectedValue="{Binding DocumentContextMenu, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Sets different context menus to show for documents.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentContextMenu}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentContextMenu1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentContextMenu2}" />
</ComboBox>
<!--2nd column-->
<TextBlock Text="AnchorTemplate: "
VerticalAlignment="Center"
Grid.Row="0"
Grid.Column="2"
Margin="40,0,0,0"/>
<ComboBox Grid.Column="3"
Width="120"
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding AnchorTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different ControlTemplate for LayoutAnchorControl.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultAnchorTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource AnchorTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource AnchorTemplate2}" />
</ComboBox>
<TextBlock Text="DocumentHeaderTemplate: "
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="2"
Margin="40,0,0,0" />
<ComboBox Grid.Row="1"
Grid.Column="3"
VerticalAlignment="Center"
Margin="5"
Width="120"
SelectedValue="{Binding DocumentHeaderTemplate, ElementName=_dockingManager}"
SelectedValuePath="Tag"
ToolTip="Displays different data template to use for document headers.">
<ComboBoxItem Content="Default"
Tag="{StaticResource DefaultDocumentHeaderTemplate}" />
<ComboBoxItem Content="Template1"
Tag="{StaticResource DocumentHeaderTemplate1}" />
<ComboBoxItem Content="Template2"
Tag="{StaticResource DocumentHeaderTemplate2}" />
</ComboBox>
<TextBlock Text="AutoHideWindowClosingTimer:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="2"
Margin="40,0,0,0"/>
<xctk:IntegerUpDown x:Name="_integerUpDown"
Grid.Row="2"
Grid.Column="3"
VerticalAlignment="Center"
Margin="5"
Width="120"
Value="{Binding AutoHideWindowClosingTimer, ElementName=_dockingManager, ValidatesOnExceptions=True}"
ToolTip="Set the time (in ms, ex: 2000, 3000, 6000) it will take to close the AutoHideWindow (Agenda/Contacts) when not moused over or active."/>
<TextBlock Text="AllowMixedOrientation:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="2"
Margin="40,0,0,0" />
<CheckBox Grid.Row="3"
Grid.Column="3"
Width="120"
IsChecked="{Binding AllowMixedOrientation, ElementName=_dockingManager}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Sets whether the docking manager should allow mixed orientation for document panes." />
</Grid>
</GroupBox>
<Grid Grid.Row="1"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Grid.Row="1">
<xcad:DockingManager x:Name="_dockingManager"
Height="300"
MaxHeight="395"
Layout="{StaticResource DefaultLayout}"
DocumentPaneControlStyle="{StaticResource DefaultDocumentPaneControlStyle}"
AnchorSideTemplate="{StaticResource DefaultAnchorSideTemplate}"
AnchorTemplate="{StaticResource DefaultAnchorTemplate}"
DocumentHeaderTemplate="{StaticResource DefaultDocumentHeaderTemplate}"
AutoHideWindowClosingTimer="1000"
DocumentContextMenu="{StaticResource DefaultDocumentContextMenu}"
BorderBrush="Black"
BorderThickness="1"
AllowMixedOrientation="True">
</xcad:DockingManager>
</StackPanel>
</Grid>
</Grid>
</local:DemoView>

49
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockPropertiesView.xaml.cs

@ -0,0 +1,49 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System;
using System.Windows;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views
{
/// <summary>
/// Interaction logic for DockingManagerPropertiesView.xaml
/// </summary>
public partial class AvalonDockPropertiesView : DemoView
{
public AvalonDockPropertiesView()
{
InitializeComponent();
}
}
public class GenericResourceDictionary : ResourceDictionary
{
public GenericResourceDictionary()
{
this.Source = new Uri( @"/" +
#if NET5
"Xceed.Wpf.AvalonDock.NET5" +
#elif NETCORE
"Xceed.Wpf.AvalonDock.NETCore" +
#else
"Xceed.Wpf.AvalonDock" +
#endif
";component/Themes/generic.xaml", UriKind.Relative );
}
}
}

102
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockSourcesView.xaml

@ -0,0 +1,102 @@
<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views.AvalonDockSourcesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:localView="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views"
xmlns:views="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
mc:Ignorable="d"
Title="Sources">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>DocumentsSource/AnchorablesSource properties allows you to bind the DockingManager to a collection source from XAML.</Run>
<LineBreak />
<Run>ILayoutUpdateStrategy is mainly used to modify or position a LayoutContent when DockingManager.DocumentsSource/AnchorablesSource changes.</Run>
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<DataTemplate DataType="{x:Type views:Page}">
<views:PageView />
</DataTemplate>
<DataTemplate DataType="{x:Type views:Document}">
<views:DocumentView />
</DataTemplate>
<DataTemplate DataType="{x:Type views:Note}">
<views:NoteView />
</DataTemplate>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Usage:"
Style="{StaticResource Header}" />
<StackPanel Grid.Row="1">
<xcad:DockingManager x:Name="_dockingManager"
DocumentsSource="{Binding Documents}"
AnchorablesSource="{Binding Anchorables}"
Height="350"
MaxHeight="450"
AllowMixedOrientation="True"
BorderBrush="Black"
BorderThickness="1">
<xcad:DockingManager.LayoutUpdateStrategy>
<localView:LayoutManager />
</xcad:DockingManager.LayoutUpdateStrategy>
<xcad:DockingManager.LayoutItemContainerStyleSelector>
<localView:ContainerStyleSelector>
<!-- StyleSelector that defines a Style for a LayoutDocument. This defines the LayoutDocument title according to the DocumentBase Title property.-->
<localView:ContainerStyleSelector.LayoutItemStyle>
<Style TargetType="{x:Type xcad:LayoutItem}">
<Setter Property="Title" Value="{Binding Model.Title}" />
</Style>
</localView:ContainerStyleSelector.LayoutItemStyle>
<!-- StyleSelector that defines a Style for a LayoutAnchorable. This defines the LayoutAnchorable title according to the Control content property.-->
<localView:ContainerStyleSelector.LayoutAnchorableItemStyle>
<Style TargetType="{x:Type xcad:LayoutAnchorableItem}">
<Setter Property="Title" Value="{Binding Model.Content}" />
<Setter Property="ContentId" Value="{Binding Model.Content}" />
</Style>
</localView:ContainerStyleSelector.LayoutAnchorableItemStyle>
</localView:ContainerStyleSelector>
</xcad:DockingManager.LayoutItemContainerStyleSelector>
</xcad:DockingManager>
</StackPanel>
</Grid>
</local:DemoView>

117
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/AvalonDock/Views/AvalonDockSourcesView.xaml.cs

@ -0,0 +1,117 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************/
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Xceed.Wpf.AvalonDock.Layout;
using Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Resources;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.AvalonDock.Views
{
/// <summary>
/// Interaction logic for AvalonDockSourcesView.xaml
/// </summary>
public partial class AvalonDockSourcesView : DemoView
{
public AvalonDockSourcesView()
{
InitializeComponent();
this.Documents = new ObservableCollection<DocumentBase>()
{
new Resources.Page(){ Title = "Page" },
new Resources.Document(){ Title = "Document" },
new Resources.Note(){ Title = "Notes" },
};
this.Anchorables = new ObservableCollection<Control>()
{
new Label() { Content = "Tools" },
new Label() { Content = "Settings" }
};
this.DataContext = this;
}
public ObservableCollection<DocumentBase> Documents
{
get; private set;
}
public ObservableCollection<Control> Anchorables
{
get; private set;
}
}
// Custom LayoutUpdateStrategy class to call when AvalonDock needs to position an anchorable or a document inside an existing layout model.
public class LayoutManager : ILayoutUpdateStrategy
{
// Performs actions before an anchorable is to be inserted.
public bool BeforeInsertAnchorable( LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer )
{
return false;
}
// Performs actions after an anchorable has been inserted.
public void AfterInsertAnchorable( LayoutRoot layout, LayoutAnchorable anchorableShown )
{
}
// Performs actions before a document is to be inserted.
public bool BeforeInsertDocument( LayoutRoot layout, LayoutDocument documentToShow, ILayoutContainer destinationContainer )
{
var documentPanes = layout.Descendents().OfType<LayoutDocumentPane>().ToList();
if( documentPanes.Count > 0 )
documentPanes[ 0 ].Children.Add( documentToShow );
return true;
}
// Performs actions after a document has been inserted.
public void AfterInsertDocument( LayoutRoot layout, LayoutDocument anchorableShown )
{
}
}
// StyleSelector Class that allows to apply a Style for a LayoutDocument/LayoutAnchorable.
public class ContainerStyleSelector : StyleSelector
{
public Style LayoutItemStyle
{
get; set;
}
public Style LayoutAnchorableItemStyle
{
get; set;
}
public override System.Windows.Style SelectStyle( object item, System.Windows.DependencyObject container )
{
if( item is Label )
return LayoutAnchorableItemStyle;
if( item is DocumentBase )
return LayoutItemStyle;
return base.SelectStyle( item, container );
}
}
}

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Button/Views/ButtonSpinnerView.xaml

@ -62,8 +62,8 @@
<TextBlock Text="AllowSpin:" VerticalAlignment="Center" />
<CheckBox x:Name="_allowSpin" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="When true allows the ButtonSpinner to perform increment/decrement operations." />
<TextBlock Text="ShowButtonSpinner:" VerticalAlignment="Center" Grid.Row="1" />
<CheckBox x:Name="_showButtonSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." />
<TextBlock Text="ShowSpinner:" VerticalAlignment="Center" Grid.Row="1" />
<CheckBox x:Name="_showSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." />
</Grid>
</GroupBox>
@ -76,7 +76,7 @@
Width="150"
HorizontalAlignment="Left"
AllowSpin="{Binding IsChecked, ElementName=_allowSpin}"
ShowButtonSpinner="{Binding IsChecked, ElementName=_showButtonSpinner}"
ShowSpinner="{Binding IsChecked, ElementName=_showSpinner}"
Spin="ButtonSpinner_Spin">
<TextBox Text="John Smith" IsReadOnly="True" BorderThickness="0" HorizontalContentAlignment="Right" />
</xctk:ButtonSpinner>

BIN
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/OpenSourceImages/EditorComboBoxDefinition.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

38
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAdvancedContextMenuView.xaml

@ -0,0 +1,38 @@
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridAdvancedContextMenuView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="Advanced ContextMenu"
VerticalScrollBarVisibility="Disabled">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
By default the propertyGrid provides a context menu for all the properties for a given object. You can override this behavior by setting the ShowAdvancedOptions property to True, and then use the AdvancedOptionsMenu property to provide a custom context menu for the properties.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<xctk:PropertyGridContextMenu x:Key="AdvancedOptionsMenu">
<MenuItem Header="Copy"
Click="MenuItem_Click" />
</xctk:PropertyGridContextMenu>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<xctk:PropertyGrid x:Name="_propertyGrid"
Width="450"
MaxHeight="245"
Margin="10"
ShowAdvancedOptions="True"
SelectedObject="{Binding}"
AdvancedOptionsMenu="{StaticResource AdvancedOptionsMenu}">
</xctk:PropertyGrid>
</Grid>
</local:DemoView>

76
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridAdvancedContextMenuView.xaml.cs

@ -0,0 +1,76 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Xceed.Wpf.Toolkit.PropertyGrid;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{
/// <summary>
/// Interaction logic for PropertyGridAdvancedContextMenuView.xaml
/// </summary>
public partial class PropertyGridAdvancedContextMenuView : DemoView
{
public PropertyGridAdvancedContextMenuView()
{
InitializeComponent();
var selObject = new Person()
{
FirstName = "John",
LastName = "Doe"
};
this.DataContext = selObject;
}
private void MenuItem_Click( object sender, RoutedEventArgs e )
{
MenuItem menuItem = sender as MenuItem;
if( menuItem != null && menuItem.DataContext is PropertyItem )
{
Clipboard.SetData( DataFormats.Text, ( ( PropertyItem )menuItem.DataContext ).Value );
}
}
private class Person
{
public string FirstName
{
get; set;
}
public string LastName
{
get; set;
}
}
}
}

45
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridEditorComboBoxDefinitionSourceView.xaml

@ -0,0 +1,45 @@
<!--**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridEditorComboBoxDefinitionSourceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="PropertyGrid EditorComboBoxDefinition Source" Height="450" Width="800">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
When using the PropertyGrid EditorComboBoxDefinition, you can bind its ItemsSource to a non-static collection source.
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
<Image Source="..\OpenSourceImages\EditorComboBoxDefinition.png" Width="660" Height="430"/>
</local:DemoView>

52
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs

@ -0,0 +1,52 @@
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2021 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views
{
/// <summary>
/// Interaction logic for PropertyGridEditorComboBoxDefinitionSourceView.xaml
/// </summary>
public partial class PropertyGridEditorComboBoxDefinitionSourceView : DemoView
{
public PropertyGridEditorComboBoxDefinitionSourceView()
{
InitializeComponent();
}
}
}

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridPropertyItemStyleView.xaml

@ -54,7 +54,7 @@
PreparePropertyItem="OnPreparePropertyItem">
<xctk:PropertyGrid.PropertyContainerStyle>
<!--This style will be set to all PropertyItem instances (direct and expanded) in the property grid. -->
<Style TargetType="{x:Type xctk:PropertyItemBase}">
<Style TargetType="{x:Type xctk:PropertyItem}" BasedOn="{StaticResource {x:Type xctk:PropertyItem}}">
<Setter Property="Foreground" Value="Red" />
</Style>
</xctk:PropertyGrid.PropertyContainerStyle>

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/PropertyGrid/Views/PropertyGridPropertyItemStyleView.xaml.cs

@ -15,13 +15,6 @@
************************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using System.Linq;
using System.Collections.ObjectModel;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
using Xceed.Wpf.Toolkit.PropertyGrid;

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingAvalonDockView.xaml

@ -27,7 +27,11 @@
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>Changes the themes of the AvalonDock controls. Available themes are System, HighContrast, Aero, VS2010, Metro, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the AvalonDock controls. Available themes are System, HighContrast, Aero, VS2010, Metro, Office2007, Windows10, MaterialDesign(Plus only) and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.AvalonDock.Themes.xxx.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>Some features of this sample are only available in the "Plus" version.</Run>
<LineBreak />

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingCoreWPFView.xaml

@ -25,7 +25,11 @@
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the WPF controls. Available themes are System, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Themes.Office2007.dll or Xceed.Wpf.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the WPF controls. Available themes are System, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.Themes.Office2007.dll, Xceed.Wpf.Themes.Windows10.dll, Xceed.Wpf.Themes.MaterialDesign.dll, Xceed.Wpf.Themes.MaterialDesignColors.dll or Xceed.Wpf.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingDataGridView.xaml

@ -27,7 +27,11 @@
x:Name="_demo">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the datagrid control. Available themes are System, HighContrast, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.DataGrid.Themes.Office2007.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<Run>Changes the themes of the datagrid control. Available themes are System, HighContrast, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.DataGrid.Themes.Office2007.dll, Xceed.Wpf.DataGrid.Themes.Windows10.dll, Xceed.Wpf.DataGrid.Themes.MaterialDesign.dll or Xceed.Wpf.DataGrid.Themes.Metro.dll assemblies are necessary to use these themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingExtendedToolkitView.xaml

@ -23,17 +23,22 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="Theming Toolkit Plus For WPF"
x:Name="_demo">
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, HighContrast, Office2007, Windows10 and Metro with accent color. The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run>
<local:DemoView.Description>
<Paragraph FontSize="14" FontFamily="Segoe">
<Run>Changes the themes of the Toolkit for WPF controls. Available themes are System, HighContrast, Office2007, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.Toolkit.Themes.Office2007.dll, Xceed.Wpf.Toolkit.Themes.Windows10.dll, Xceed.Wpf.Toolkit.Themes.MaterialDesign.dll or Xceed.Wpf.Toolkit.Themes.Metro.dll assemblies are necessary to use the themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
</Paragraph>
</local:DemoView.Description>
</Paragraph>
</local:DemoView.Description>

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingExtendedToolkitView.xaml.cs

@ -21,6 +21,7 @@ using System;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Documents;
using Microsoft.Win32;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/Theming/Views/ThemingListBoxView.xaml

@ -30,7 +30,11 @@
<Run>Dress Up Your App in Style in Minutes</Run>
<LineBreak />
<LineBreak />
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, HighContrast, Office2007, LiveExplorer, MediaPlayer, Windows10 and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, HighContrast, Office2007, LiveExplorer, MediaPlayer, Windows10, MaterialDesign and Metro with accent color.</Run>
<LineBreak />
<LineBreak />
<Run>The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />

27
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Samples/TimeSpan/Views/TimeSpanView.xaml

@ -29,16 +29,6 @@
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ObjectDataProvider x:Key="enumDateTimePart"
MethodName="GetValues"
ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="xctk:DateTimePart" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</local:DemoView.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -119,10 +109,21 @@
<ComboBox x:Name="_currentDateTimePart"
Grid.Row="5"
Grid.Column="1"
ItemsSource="{Binding Source={StaticResource enumDateTimePart}}"
SelectedItem="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
SelectedValue="{Binding CurrentDateTimePart, ElementName=_timeSpanUpDown}"
SelectedValuePath="Tag"
Margin="5,5,25,5"
ToolTip="Must match a DateTimePart of the TimeSpanUpDown" />
ToolTip="Must match a DateTimePart of the TimeSpanUpDown" >
<ComboBoxItem Content="Day"
Tag="{x:Static xctk:DateTimePart.Day}" />
<ComboBoxItem Content="Hour24"
Tag="{x:Static xctk:DateTimePart.Hour24}" />
<ComboBoxItem Content="Minute"
Tag="{x:Static xctk:DateTimePart.Minute}" />
<ComboBoxItem Content="Second"
Tag="{x:Static xctk:DateTimePart.Second}" />
<ComboBoxItem Content="Millisecond"
Tag="{x:Static xctk:DateTimePart.Millisecond}" />
</ComboBox>
<!-- 2nd column-->
<TextBlock Grid.Column="2"

82
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/Xceed.Wpf.Toolkit.LiveExplorer.csproj

@ -84,19 +84,19 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero.dll">
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.Aero\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.Aero\bin\$(Configuration)\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro.dll">
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.Metro\bin\Debug\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.Metro\bin\$(Configuration)\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010.dll">
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.VS2010\bin\Debug\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<HintPath>..\Xceed.Wpf.AvalonDock.Themes.VS2010\bin\$(Configuration)\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.dll">
<HintPath>..\Xceed.Wpf.AvalonDock\bin\Debug\Xceed.Wpf.AvalonDock.dll</HintPath>
<HintPath>..\Xceed.Wpf.AvalonDock\bin\$(Configuration)\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.dll">
<HintPath>..\Xceed.Wpf.Toolkit\bin\Debug\Xceed.Wpf.Toolkit.dll</HintPath>
<HintPath>..\Xceed.Wpf.Toolkit\bin\$(Configuration)\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -111,6 +111,22 @@
<Compile Include="HomeView.xaml.cs">
<DependentUpon>HomeView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Resources\Document.cs" />
<Compile Include="Samples\AvalonDock\Resources\DocumentBase.cs" />
<Compile Include="Samples\AvalonDock\Resources\DocumentView.xaml.cs">
<DependentUpon>DocumentView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Resources\Note.cs" />
<Compile Include="Samples\AvalonDock\Resources\NoteView.xaml.cs">
<DependentUpon>NoteView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Resources\Page.cs" />
<Compile Include="Samples\AvalonDock\Resources\PageView.xaml.cs">
<DependentUpon>PageView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Views\AvalonDockSourcesView.xaml.cs">
<DependentUpon>AvalonDockSourcesView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Views\AvalonDockView.xaml.cs">
<DependentUpon>AvalonDockView.xaml</DependentUpon>
</Compile>
@ -179,6 +195,9 @@
<Compile Include="Samples\DateTime\Views\DateTimeView.xaml.cs">
<DependentUpon>DateTimeView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\AvalonDock\Views\AvalonDockPropertiesView.xaml.cs">
<DependentUpon>AvalonDockPropertiesView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\ExtTabControl\Views\ExtTabControlView.xaml.cs">
<DependentUpon>ExtTabControlView.xaml</DependentUpon>
</Compile>
@ -279,6 +298,12 @@
<Compile Include="Samples\PropertyGrid\Resources\LastNameUserControlEditor.xaml.cs">
<DependentUpon>LastNameUserControlEditor.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\PropertyGrid\Views\PropertyGridAdvancedContextMenuView.xaml.cs">
<DependentUpon>PropertyGridAdvancedContextMenuView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\PropertyGrid\Views\PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs">
<DependentUpon>PropertyGridEditorComboBoxDefinitionSourceView.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\PropertyGrid\Views\PropertyGridPropertyItemStyleView.xaml.cs">
<DependentUpon>PropertyGridPropertyItemStyleView.xaml</DependentUpon>
</Compile>
@ -454,6 +479,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\AvalonDock\Resources\DocumentView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\AvalonDock\Resources\NoteView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\AvalonDock\Resources\PageView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\AvalonDock\Views\AvalonDockSourcesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\AvalonDock\Views\AvalonDockView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -542,6 +583,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\AvalonDock\Views\AvalonDockPropertiesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\ExtTabControl\Views\ExtTabControlView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -666,6 +711,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\PropertyGrid\Views\PropertyGridAdvancedContextMenuView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\PropertyGrid\Views\PropertyGridEditorComboBoxDefinitionSourceView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Samples\PropertyGrid\Views\PropertyGridPropertyItemStyleView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -1431,6 +1484,25 @@
<ItemGroup>
<Resource Include="Samples\DataGrid\OpenSourceImages\DataGrid.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\AvalonDockSourcesView.xaml.cs.txt" />
<Resource Include="CodeFiles\AvalonDockSourcesView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\AvalonDockPropertiesView.xaml.cs.txt" />
<Resource Include="CodeFiles\AvalonDockPropertiesView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\PropertyGridAdvancedContextMenuView.xaml.cs.txt" />
<Resource Include="CodeFiles\PropertyGridAdvancedContextMenuView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="CodeFiles\PropertyGridEditorComboBoxDefinitionSourceView.xaml.cs.txt" />
<Resource Include="CodeFiles\PropertyGridEditorComboBoxDefinitionSourceView.xaml.txt" />
</ItemGroup>
<ItemGroup>
<Resource Include="Samples\PropertyGrid\OpenSourceImages\EditorComboBoxDefinition.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

8
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit.LiveExplorer/app.config

@ -12,12 +12,4 @@
</setting>
</Xceed.Wpf.Toolkit.LiveExplorer.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Xceed.Wpf.Toolkit" publicKeyToken="BA83FF368B7563C6" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.2.14066.5" newVersion="2.2.14066.5"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

2
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.2";
public const string BaseVersion = "4.3";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";

24
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Implementation/ButtonSpinner.cs

@ -62,7 +62,7 @@ namespace Xceed.Wpf.Toolkit
private static void AllowSpinPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
ButtonSpinner source = d as ButtonSpinner;
source.OnAllowSpinChanged( (bool)e.OldValue, (bool)e.NewValue );
source.OnAllowSpinChanged( ( bool )e.OldValue, ( bool )e.NewValue );
}
#endregion //AllowSpin
@ -94,7 +94,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (Location)GetValue( SpinnerLocationProperty );
return ( Location )GetValue( SpinnerLocationProperty );
}
set
{
@ -111,7 +111,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (double)GetValue( SpinnerWidthProperty );
return ( double )GetValue( SpinnerWidthProperty );
}
set
{
@ -128,7 +128,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (double)GetValue( SpinnerHeightProperty );
return ( double )GetValue( SpinnerHeightProperty );
}
set
{
@ -145,7 +145,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (DataTemplate)GetValue( SpinnerDownContentTemplateProperty );
return ( DataTemplate )GetValue( SpinnerDownContentTemplateProperty );
}
set
{
@ -162,7 +162,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (DataTemplate)GetValue( SpinnerDownDisabledContentTemplateProperty );
return ( DataTemplate )GetValue( SpinnerDownDisabledContentTemplateProperty );
}
set
{
@ -179,7 +179,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (DataTemplate)GetValue( SpinnerUpContentTemplateProperty );
return ( DataTemplate )GetValue( SpinnerUpContentTemplateProperty );
}
set
{
@ -196,7 +196,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (DataTemplate)GetValue( SpinnerUpDisabledContentTemplateProperty );
return ( DataTemplate )GetValue( SpinnerUpDisabledContentTemplateProperty );
}
set
{
@ -265,7 +265,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (bool)GetValue( ShowSpinnerProperty );
return ( bool )GetValue( ShowSpinnerProperty );
}
set
{
@ -423,11 +423,11 @@ namespace Xceed.Wpf.Toolkit
break;
}
case Key.Enter:
case Key.Enter:
{
//Do not Spin on enter Key when spinners have focus
if( ((this.IncreaseButton != null) && (this.IncreaseButton.IsFocused))
|| (( this.DecreaseButton != null ) && this.DecreaseButton.IsFocused ))
if( ( ( this.IncreaseButton != null ) && ( this.IncreaseButton.IsFocused ) )
|| ( ( this.DecreaseButton != null ) && this.DecreaseButton.IsFocused ) )
{
e.Handled = true;
}

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Aero2.NormalColor.xaml

@ -106,13 +106,16 @@
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShowSpinner"
<Trigger Property="ShowButtonSpinner"
Value="False">
<Setter Property="Visibility"
Value="Hidden"
Value="Collapsed"
TargetName="gridContent" />
<Setter Property="Width"
Value="0"
</Trigger>
<Trigger Property="ShowSpinner"
Value="False">
<Setter Property="Visibility"
Value="Collapsed"
TargetName="gridContent" />
</Trigger>
<Trigger Property="IsMouseOver"

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/ButtonSpinner/Themes/Generic.xaml

@ -103,13 +103,16 @@
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShowSpinner"
<Trigger Property="ShowButtonSpinner"
Value="False">
<Setter Property="Visibility"
Value="Hidden"
Value="Collapsed"
TargetName="gridContent" />
<Setter Property="Width"
Value="0"
</Trigger>
<Trigger Property="ShowSpinner"
Value="False">
<Setter Property="Visibility"
Value="Collapsed"
TargetName="gridContent" />
</Trigger>
<Trigger Property="IsEnabled"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Aero2.NormalColor.xaml

@ -119,6 +119,7 @@
SpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
SpinnerWidth="{TemplateBinding ButtonSpinnerWidth}"
SpinnerHeight="{TemplateBinding ButtonSpinnerHeight}"
SpinnerUpContentTemplate="{TemplateBinding ButtonSpinnerUpContentTemplate}"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CalculatorUpDown/Themes/Generic.xaml

@ -143,6 +143,7 @@
SpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
SpinnerWidth="{TemplateBinding ButtonSpinnerWidth}"
SpinnerHeight="{TemplateBinding ButtonSpinnerHeight}"
SpinnerUpContentTemplate="{TemplateBinding ButtonSpinnerUpContentTemplate}"

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControl.cs

@ -539,6 +539,10 @@ namespace Xceed.Wpf.Toolkit
var baseItem = e.Parameter;
var newItemType = baseItem.GetType();
if( typeof( ICloneable ).IsAssignableFrom( newItemType ) )
return ( ( ICloneable )baseItem ).Clone();
var newItem = this.CreateNewItem( newItemType );
var type = newItemType;

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/CollectionControl/Implementation/CollectionControlDialog.xaml.cs

@ -237,7 +237,7 @@ namespace Xceed.Wpf.Toolkit
Debug.Assert( result != null );
if( result != null )
{
var properties = sourceType.GetProperties();
var properties = sourceType.GetProperties( BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly );
foreach( var propertyInfo in properties )
{

37
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Converters/PrintableFontFamilyConverter.cs

@ -0,0 +1,37 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System;
using System.Globalization;
using System.Windows.Data;
using Xceed.Wpf.Toolkit.Core.Utilities;
namespace Xceed.Wpf.Toolkit.Core.Converters
{
public class PrintableFontFamilyConverter : IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
return FontUtilities.GetFontFamily( value as string );
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
throw new NotImplementedException();
}
}
}

11
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/FontUtilities.cs

@ -30,6 +30,7 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
{
get
{
#if !VS2008
// Workaround for a WPF 4 bug.
foreach( FontFamily font in Fonts.SystemFontFamilies )
@ -95,5 +96,15 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
yield return FontStretches.UltraExpanded;
}
}
internal static FontFamily GetFontFamily( string fontFamilyName )
{
return FontUtilities.Families.FirstOrDefault( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) == fontFamilyName );
}
internal static string GetFontFamilyName( FontFamily fontFamily )
{
return fontFamily.FamilyNames.Values.FirstOrDefault();
}
}
}

12
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Core/Utilities/ListUtilities.cs

@ -33,12 +33,16 @@ namespace Xceed.Wpf.Toolkit.Core.Utilities
internal static Type GetListItemType( Type listType )
{
Type iListOfT = listType.GetInterfaces().FirstOrDefault(
var iListOfT = listType.GetInterfaces().FirstOrDefault(
( i ) => i.IsGenericType && i.GetGenericTypeDefinition() == typeof( IList<> ) );
return ( iListOfT != null )
? iListOfT.GetGenericArguments()[ 0 ]
: null;
if( iListOfT != null )
return iListOfT.GetGenericArguments()[ 0 ];
if( listType.IsGenericType && listType.GetGenericTypeDefinition() == typeof( IEnumerable<> ) )
return listType.GetGenericArguments()[ 0 ];
return null;
}
internal static bool IsCollectionOfItems( Type colType )

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Aero2.NormalColor.xaml

@ -135,7 +135,8 @@
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
@ -152,6 +153,7 @@
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
AutoSelectBehavior="OnFocus"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="NoWrap"
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}}"

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimePicker/Themes/Generic.xaml

@ -159,7 +159,8 @@
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
@ -173,6 +174,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="True"
AutoSelectBehavior="OnFocus"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Aero2.NormalColor.xaml

@ -68,7 +68,8 @@
SpinnerUpDisabledContentTemplate="{TemplateBinding ButtonSpinnerUpDisabledContentTemplate}"
SpinnerDownDisabledContentTemplate="{TemplateBinding ButtonSpinnerDownDisabledContentTemplate}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
@ -82,6 +83,7 @@
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
AutoSelectBehavior="OnFocus"
IsTabStop="True"
MinWidth="20"
AcceptsReturn="False"

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Themes/Generic.xaml

@ -80,7 +80,8 @@
SpinnerUpDisabledContentTemplate="{TemplateBinding ButtonSpinnerUpDisabledContentTemplate}"
SpinnerDownDisabledContentTemplate="{TemplateBinding ButtonSpinnerDownDisabledContentTemplate}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
ShowSpinner="{TemplateBinding ShowButtonSpinner}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
@ -95,6 +96,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="True"
AutoSelectBehavior="OnFocus"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml

@ -66,6 +66,7 @@
VerticalContentAlignment="Stretch"
AllowSpin="{Binding AllowSpin, RelativeSource={RelativeSource TemplatedParent}}"
ShowSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
ShowButtonSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerLocation="{Binding ButtonSpinnerLocation, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerWidth="{Binding ButtonSpinnerWidth, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerHeight="{Binding ButtonSpinnerHeight, RelativeSource={RelativeSource TemplatedParent}}"

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/NumericUpDown/Themes/Generic.xaml

@ -66,6 +66,7 @@
VerticalContentAlignment="Stretch"
AllowSpin="{Binding AllowSpin, RelativeSource={RelativeSource TemplatedParent}}"
ShowSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
ShowButtonSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerLocation="{Binding ButtonSpinnerLocation, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerWidth="{Binding ButtonSpinnerWidth, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerHeight="{Binding ButtonSpinnerHeight, RelativeSource={RelativeSource TemplatedParent}}"

38
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Primitives/DateTimeUpDownBase.cs

@ -43,12 +43,26 @@ namespace Xceed.Wpf.Toolkit.Primitives
#region CurrentDateTimePart
public static readonly DependencyProperty CurrentDateTimePartProperty = DependencyProperty.Register( "CurrentDateTimePart", typeof( DateTimePart )
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( DateTimePart.Other, OnCurrentDateTimePartChanged ) );
, typeof( DateTimeUpDownBase<T> ), new UIPropertyMetadata( DateTimePart.Other, OnCurrentDateTimePartChanged, OnCurrentDateTimePartCoerce ) );
private static object OnCurrentDateTimePartCoerce( DependencyObject d, object baseValue )
{
DateTimeUpDownBase<T> dateTimeUpDownBase = d as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
return dateTimeUpDownBase.OnCurrentDateTimePartCoerce( baseValue );
return baseValue;
}
protected virtual object OnCurrentDateTimePartCoerce( object baseValue )
{
return baseValue;
}
public DateTimePart CurrentDateTimePart
{
get
{
return (DateTimePart)GetValue( CurrentDateTimePartProperty );
return ( DateTimePart )GetValue( CurrentDateTimePartProperty );
}
set
{
@ -60,7 +74,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
DateTimeUpDownBase<T> dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnCurrentDateTimePartChanged( (DateTimePart)e.OldValue, (DateTimePart)e.NewValue );
dateTimeUpDownBase.OnCurrentDateTimePartChanged( ( DateTimePart )e.OldValue, ( DateTimePart )e.NewValue );
}
protected virtual void OnCurrentDateTimePartChanged( DateTimePart oldValue, DateTimePart newValue )
@ -78,7 +92,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
get
{
return (int)GetValue( StepProperty );
return ( int )GetValue( StepProperty );
}
set
{
@ -90,7 +104,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
var dateTimeUpDownBase = o as DateTimeUpDownBase<T>;
if( dateTimeUpDownBase != null )
dateTimeUpDownBase.OnStepChanged( (int)e.OldValue, (int)e.NewValue );
dateTimeUpDownBase.OnStepChanged( ( int )e.OldValue, ( int )e.NewValue );
}
protected virtual void OnStepChanged( int oldValue, int newValue )
@ -221,7 +235,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
protected virtual void PerformMouseSelection()
{
var dateTimeInfo = this.GetDateTimeInfo( TextBox.SelectionStart );
if( ( dateTimeInfo != null) && (dateTimeInfo.Type == DateTimePart.Other) )
if( ( dateTimeInfo != null ) && ( dateTimeInfo.Type == DateTimePart.Other ) )
{
this.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action( () =>
{
@ -230,7 +244,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
}
) );
return;
}
}
this.Select( dateTimeInfo );
}
@ -253,12 +267,12 @@ namespace Xceed.Wpf.Toolkit.Primitives
internal DateTimeInfo GetDateTimeInfo( DateTimePart part )
{
return _dateTimeInfoList.FirstOrDefault( ( info ) =>info.Type == part );
return _dateTimeInfoList.FirstOrDefault( ( info ) => info.Type == part );
}
internal virtual void Select( DateTimeInfo info )
{
if( (info != null) && !info.Equals( _selectedDateTimeInfo ) && ( this.TextBox != null) && !string.IsNullOrEmpty( this.TextBox.Text ) )
if( ( info != null ) && !info.Equals( _selectedDateTimeInfo ) && ( this.TextBox != null ) && !string.IsNullOrEmpty( this.TextBox.Text ) )
{
_fireSelectionChangedEvent = false;
this.TextBox.Select( info.StartPosition, info.Length );
@ -322,7 +336,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
this.Select( this.GetPreviousDateTimeInfo( nextSelectionStart - 1 ) );
}
}
}
private DateTimeInfo GetNextDateTimeInfo( int nextSelectionStart )
{
@ -360,7 +374,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
DateTimeInfo initialDateTimeInfo = previousDateTimeInfo;
while( (previousDateTimeInfo != null) && (previousDateTimeInfo.Type == DateTimePart.Other) )
while( ( previousDateTimeInfo != null ) && ( previousDateTimeInfo.Type == DateTimePart.Other ) )
{
previousDateTimeInfo = this.GetDateTimeInfo( previousDateTimeInfo.StartPosition - 1 );
if( previousDateTimeInfo == null )
@ -377,7 +391,7 @@ namespace Xceed.Wpf.Toolkit.Primitives
{
if( _selectedDateTimeInfo == null )
{
this.Select( (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : this.GetDateTimeInfo( 0 ) );
this.Select( ( this.CurrentDateTimePart != DateTimePart.Other ) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : this.GetDateTimeInfo( 0 ) );
}
}

5
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Properties/AssemblyInfo.cs

@ -58,9 +58,12 @@ using System.Windows.Markup;
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//inside a <PropertyGroup>. For example, if you are using US English
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

55
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Attributes/CategoryPropertyOrderAttribute.cs

@ -0,0 +1,55 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System;
namespace Xceed.Wpf.Toolkit.PropertyGrid.Attributes
{
public enum CategoryPropertyOrderEnum
{
Alphabetical,
Declaration
}
[AttributeUsage( AttributeTargets.Class, AllowMultiple = false )]
public class CategoryPropertyOrderAttribute : Attribute
{
#region Properties
#region CategoryPropertyOrder
public CategoryPropertyOrderEnum CategoryPropertyOrder
{
get;
private set;
}
#endregion
#endregion
#region constructor
public CategoryPropertyOrderAttribute( CategoryPropertyOrderEnum categoryPropertyOrder = CategoryPropertyOrderEnum.Alphabetical )
{
CategoryPropertyOrder = categoryPropertyOrder;
}
#endregion
}
}

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Converters/PropertyItemEditorConverter.cs

@ -20,6 +20,7 @@ using System.Globalization;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using Xceed.Wpf.Toolkit.PropertyGrid.Editors;
namespace Xceed.Wpf.Toolkit.PropertyGrid.Converters
{
@ -45,7 +46,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Converters
if( !this.IsPropertySetLocally( editor, TextBoxBase.IsReadOnlyProperty ) )
{
// Set Editor.IsReadOnly to PropertyGrid.IsReadOnly & propertyItem.IsReadOnly.
editorIsReadOnlyPropertyInfo.SetValue( editor, isPropertyGridReadOnly.Value ? true : isPropertyItemReadOnly.Value, null );
var isReadOnlyValue = isPropertyGridReadOnly.Value
? true
: ( editor is PropertyGridEditorCollectionControl ) ? false : isPropertyItemReadOnly.Value;
editorIsReadOnlyPropertyInfo.SetValue( editor, isReadOnlyValue, null );
}
}
// No Editor.IsReadOnly property, set the Editor.IsEnabled property.
@ -56,8 +62,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Converters
{
if( !this.IsPropertySetLocally( editor, UIElement.IsEnabledProperty ) )
{
// Set Editor.IsEnabled to PropertyGrid.IsReadOnly & propertyItem.IsReadOnly.
editorIsEnabledPropertyInfo.SetValue( editor, isPropertyGridReadOnly.Value ? false : !isPropertyItemReadOnly.Value, null );
// Set Editor.IsReadOnly to PropertyGrid.IsReadOnly & propertyItem.IsReadOnly.
var isEnabledValue = isPropertyGridReadOnly.Value
? false
: ( editor is PropertyGridEditorCollectionControl ) ? true : !isPropertyItemReadOnly.Value;
editorIsEnabledPropertyInfo.SetValue( editor, isEnabledValue, null );
}
}
}

23
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/CollectionEditor.cs

@ -39,7 +39,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
protected override void SetControlProperties( PropertyItem propertyItem )
{
var propertyGrid = propertyItem.ParentElement as PropertyGrid;
var propertyGrid = this.GetParentPropertyGrid( propertyItem.ParentElement );
if( propertyGrid != null )
{
// Use the PropertyGrid.EditorDefinitions for the CollectionControl's propertyGrid.
@ -49,6 +49,25 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
}
}
private PropertyGrid GetParentPropertyGrid( FrameworkElement element )
{
var propertyGrid = element as PropertyGrid;
if( propertyGrid == null )
{
var parentPropertyItem = element as PropertyItem;
while( ( parentPropertyItem != null ) && ( propertyGrid == null ) )
{
propertyGrid = parentPropertyItem.ParentElement as PropertyGrid;
if( propertyGrid == null )
{
parentPropertyItem = parentPropertyItem.ParentElement as PropertyItem;
}
}
}
return propertyGrid;
}
private void Editor_CollectionUpdated( object sender, RoutedEventArgs e )
{
var propertyGridEditorCollectionControl = sender as PropertyGridEditorCollectionControl;
@ -57,7 +76,7 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
var propertyItem = propertyGridEditorCollectionControl.DataContext as PropertyItem;
if( propertyItem != null )
{
var propertyGrid = propertyItem.ParentElement as PropertyGrid;
var propertyGrid = this.GetParentPropertyGrid( propertyItem.ParentElement );
if( propertyGrid != null )
{
propertyGrid.RaiseEvent( new PropertyValueChangedEventArgs( PropertyGrid.PropertyValueChangedEvent, propertyItem, null, propertyItem.Instance ) );

15
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGrid.cs

@ -31,6 +31,7 @@ using System.Collections.ObjectModel;
using System.Collections;
using Xceed.Wpf.Toolkit.Core.Utilities;
using System.Linq.Expressions;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
namespace Xceed.Wpf.Toolkit.PropertyGrid
{
@ -1053,10 +1054,12 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
}
var parentPropertyItem = modifiedPropertyItem.ParentNode as PropertyItem;
if( ( parentPropertyItem != null ) && parentPropertyItem.IsExpandable )
while( ( parentPropertyItem != null ) && parentPropertyItem.IsExpandable )
{
//Rebuild Editor for parent propertyItem if one of its sub-propertyItem have changed.
this.RebuildPropertyItemEditor( parentPropertyItem );
parentPropertyItem = parentPropertyItem.ParentNode as PropertyItem;
}
}
}
@ -1544,11 +1547,21 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
{
get
{
var categoryPropertyOrderAttribute = TypeDescriptor.GetAttributes( this.SelectedObject )
.OfType<CategoryPropertyOrderAttribute>()
.FirstOrDefault();
if( this.IsCategorized
&& ( categoryPropertyOrderAttribute != null )
&& ( categoryPropertyOrderAttribute.CategoryPropertyOrder == CategoryPropertyOrderEnum.Declaration ) )
return false;
return true;
}
}
bool? IPropertyContainer.IsPropertyVisible( PropertyDescriptor pd )
{
var handler = this.IsPropertyBrowsable;

51
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyGridContextMenu.cs

@ -0,0 +1,51 @@
/*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************/
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Xceed.Wpf.Toolkit.PropertyGrid
{
public class PropertyGridContextMenu : ContextMenu
{
protected override void OnOpened( RoutedEventArgs e )
{
base.OnOpened( e );
var contextMenu = e.OriginalSource as ContextMenu;
if( ( contextMenu != null ) && ( contextMenu.PlacementTarget != null ) )
{
var control = contextMenu.PlacementTarget;
// Get PropertyItemBase parent
var parent = VisualTreeHelper.GetParent( control );
while( parent != null )
{
var propertyItemBase = parent as PropertyItemBase;
if( propertyItemBase != null )
{
contextMenu.DataContext = propertyItemBase;
break;
}
parent = VisualTreeHelper.GetParent( parent );
}
}
}
}
}

3
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/PropertyItemCollection.cs

@ -140,9 +140,10 @@ namespace Xceed.Wpf.Toolkit.PropertyGrid
}
}
SortBy( PropertyOrderPropertyName, ListSortDirection.Ascending );
if( sortAlphabetically )
{
SortBy( PropertyOrderPropertyName, ListSortDirection.Ascending );
SortBy( DisplayNamePropertyName, ListSortDirection.Ascending );
}
}

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Aero2.NormalColor.xaml

@ -842,12 +842,12 @@
</Setter>
</Style>
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}">
<pg:PropertyGridContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}">
<MenuItem Header="Reset Value"
Command="commands:PropertyItemCommands.ResetValue"
CommandParameter="{Binding}"
CommandTarget="{Binding Path=PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"/>
</ContextMenu>
</pg:PropertyGridContextMenu>
<pg:CategoryGroupStyleSelector x:Key="categoryGroupStyleSelector"
SingleDefaultCategoryItemGroupStyle="{StaticResource SingleDefaultCategoryItemGroupContainerStyle}"
@ -1097,6 +1097,9 @@
</Setter>
</Style>
<Style TargetType="{x:Type pg:PropertyItem}"
BasedOn="{StaticResource {x:Type pg:PropertyItemBase}}" />
<Style TargetType="{x:Type pg:PropertyGrid}">
<Setter Property="AdvancedOptionsMenu"
Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}}" />

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/PropertyGrid/Themes/Generic.xaml

@ -957,12 +957,12 @@
</Setter>
</Style>
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}">
<pg:PropertyGridContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}">
<MenuItem Header="Reset Value"
Command="commands:PropertyItemCommands.ResetValue"
CommandParameter="{Binding}"
CommandTarget="{Binding Path=PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"/>
</ContextMenu>
</pg:PropertyGridContextMenu>
<pg:CategoryGroupStyleSelector x:Key="categoryGroupStyleSelector"
SingleDefaultCategoryItemGroupStyle="{StaticResource SingleDefaultCategoryItemGroupContainerStyle}"
@ -1218,6 +1218,9 @@
</Setter>
</Style>
<Style TargetType="{x:Type pg:PropertyItem}"
BasedOn="{StaticResource {x:Type pg:PropertyItemBase}}" />
<Style TargetType="{x:Type pg:PropertyGrid}">
<Setter Property="AdvancedOptionsMenu"
Value="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type pg:PropertyGrid}, ResourceId=SelectedObjectAdvancedOptionsMenu}}" />

6
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBar.cs

@ -92,7 +92,7 @@ namespace Xceed.Wpf.Toolkit
if( e.AddedItems.Count == 0 )
return;
FontFamily editValue = ( FontFamily )e.AddedItems[ 0 ];
var editValue = FontUtilities.GetFontFamily( ( string )e.AddedItems[ 0 ] );
ApplyPropertyValueToSelectedText( TextElement.FontFamilyProperty, editValue );
_waitingForMouseOver = true;
}
@ -211,7 +211,7 @@ namespace Xceed.Wpf.Toolkit
if( _cmbFontFamilies != null )
{
_cmbFontFamilies.ItemsSource = FontUtilities.Families.OrderBy( fontFamily => fontFamily.Source );
_cmbFontFamilies.ItemsSource = FontUtilities.Families.OrderBy( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) ).Select( fontFamily => FontUtilities.GetFontFamilyName( fontFamily ) );
_cmbFontFamilies.SelectionChanged += new SelectionChangedEventHandler( FontFamily_SelectionChanged );
}
@ -296,7 +296,7 @@ namespace Xceed.Wpf.Toolkit
FontFamily currentFontFamily = ( FontFamily )value;
if( (currentFontFamily != null) && ( _cmbFontFamilies != null) )
{
_cmbFontFamilies.SelectedItem = currentFontFamily;
_cmbFontFamilies.SelectedItem = FontUtilities.GetFontFamilyName( currentFontFamily );
}
}

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/Themes/Aero2.NormalColor.xaml

@ -25,6 +25,7 @@
</ResourceDictionary.MergedDictionaries>
<conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<conv:PrintableFontFamilyConverter x:Key="PrintableFontFamilyConverter" />
<ControlTemplate x:Key="ThumbControlTemplate"
TargetType="{x:Type Thumb}">
@ -622,6 +623,12 @@
IsEditable="True"
Width="100"
ToolTip="Font Family">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
FontFamily="{Binding Converter={StaticResource PrintableFontFamilyConverter}, TargetNullValue=Arial}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox x:Name="_cmbFontSizes"

7
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/Themes/Generic.xaml

@ -25,6 +25,7 @@
</ResourceDictionary.MergedDictionaries>
<conv:ColorToSolidColorBrushConverter x:Key="ColorToSolidColorBrushConverter" />
<conv:PrintableFontFamilyConverter x:Key="PrintableFontFamilyConverter" />
<ControlTemplate x:Key="ThumbControlTemplate"
TargetType="{x:Type Thumb}">
@ -622,6 +623,12 @@
IsEditable="True"
Width="100"
ToolTip="Font Family" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
FontFamily="{Binding Converter={StaticResource PrintableFontFamilyConverter}, TargetNullValue=Arial}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox x:Name="_cmbFontSizes"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Aero2/Glyphs.xaml

@ -68,6 +68,7 @@
<Grid x:Key="DropDownArrowGlyph"
IsHitTestVisible="False"
Grid.Column="1"
x:Shared="False"
Margin="5">
<Path Width="9"
Height="5"
@ -79,6 +80,7 @@
<Grid x:Key="DropDownDisabledArrowGlyph"
IsHitTestVisible="False"
Grid.Column="1"
x:Shared="False"
Margin="5">
<Path Width="9"
Height="5"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Themes/Generic/Glyphs.xaml

@ -68,6 +68,7 @@
<Grid x:Key="DropDownArrowGlyph"
IsHitTestVisible="False"
Grid.Column="1"
x:Shared="False"
Margin="5">
<Path Width="9"
Height="5"
@ -79,6 +80,7 @@
<Grid x:Key="DropDownDisabledArrowGlyph"
IsHitTestVisible="False"
Grid.Column="1"
x:Shared="False"
Margin="5">
<Path Width="9"
Height="5"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Aero2.NormalColor.xaml

@ -179,6 +179,7 @@
SpinnerUpDisabledContentTemplate="{TemplateBinding ButtonSpinnerUpDisabledContentTemplate}"
SpinnerDownDisabledContentTemplate="{TemplateBinding ButtonSpinnerDownDisabledContentTemplate}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
@ -193,6 +194,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="True"
AutoSelectBehavior="OnFocus"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

2
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimePicker/Themes/Generic.xaml

@ -173,6 +173,7 @@
SpinnerUpDisabledContentTemplate="{TemplateBinding ButtonSpinnerUpDisabledContentTemplate}"
SpinnerDownDisabledContentTemplate="{TemplateBinding ButtonSpinnerDownDisabledContentTemplate}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
@ -187,6 +188,7 @@
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="True"
AutoSelectBehavior="OnFocus"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"

129
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Implementation/TimeSpanUpDown.cs

@ -31,7 +31,7 @@ namespace Xceed.Wpf.Toolkit
private static readonly int HoursInDay = 24;
private static readonly int MinutesInDay = 1440;
private static readonly int MinutesInHour = 60;
private static readonly int MinutesInHour = 60;
private static readonly int SecondsInDay = 86400;
private static readonly int SecondsInHour = 3600;
private static readonly int SecondsInMinute = 60;
@ -39,6 +39,7 @@ namespace Xceed.Wpf.Toolkit
private static readonly int MilliSecondsInHour = TimeSpanUpDown.SecondsInHour * 1000;
private static readonly int MilliSecondsInMinute = TimeSpanUpDown.SecondsInMinute * 1000;
private static readonly int MilliSecondsInSecond = 1000;
private int _defaultFractionalSecondsDigitsCount = 3;
#endregion
@ -81,7 +82,7 @@ namespace Xceed.Wpf.Toolkit
var timeSpanUpDown = o as TimeSpanUpDown;
if( timeSpanUpDown != null )
{
int digitsCount = (int)value;
int digitsCount = ( int )value;
if( digitsCount < 0 || digitsCount > 3 )
throw new ArgumentException( "Fractional seconds digits count must be between 0 and 3." );
}
@ -109,7 +110,7 @@ namespace Xceed.Wpf.Toolkit
{
get
{
return (bool)GetValue( ShowDaysProperty );
return ( bool )GetValue( ShowDaysProperty );
}
set
{
@ -121,7 +122,7 @@ namespace Xceed.Wpf.Toolkit
{
var timeSpanUpDown = o as TimeSpanUpDown;
if( timeSpanUpDown != null )
timeSpanUpDown.OnShowDaysChanged( (bool)e.OldValue, (bool)e.NewValue );
timeSpanUpDown.OnShowDaysChanged( ( bool )e.OldValue, ( bool )e.NewValue );
}
protected virtual void OnShowDaysChanged( bool oldValue, bool newValue )
@ -187,18 +188,28 @@ namespace Xceed.Wpf.Toolkit
protected override void OnCultureInfoChanged( CultureInfo oldValue, CultureInfo newValue )
{
var value = this.UpdateValueOnEnterKey
? (this.TextBox != null) ? this.ConvertTextToValue( this.TextBox.Text ) : null
? ( this.TextBox != null ) ? this.ConvertTextToValue( this.TextBox.Text ) : null
: this.Value;
this.InitializeDateTimeInfoList( value );
}
protected override void OnCurrentDateTimePartChanged( DateTimePart oldValue, DateTimePart newValue )
{
if( this.CurrentDateTimePart == DateTimePart.Millisecond && this.FractionalSecondsDigitsCount < 3 )
{
this.SetCurrentValue( TimeSpanUpDown.FractionalSecondsDigitsCountProperty, _defaultFractionalSecondsDigitsCount );
}
base.OnCurrentDateTimePartChanged( oldValue, newValue );
}
protected override void SetValidSpinDirection()
{
ValidSpinDirections validDirections = ValidSpinDirections.None;
if( !this.IsReadOnly )
{
if( this.IsLowerThan( this.Value, this.Maximum ) || !this.Value.HasValue || !this.Maximum.HasValue)
if( this.IsLowerThan( this.Value, this.Maximum ) || !this.Value.HasValue || !this.Maximum.HasValue )
validDirections = validDirections | ValidSpinDirections.Increase;
if( this.IsGreaterThan( this.Value, this.Minimum ) || !this.Value.HasValue || !this.Minimum.HasValue )
@ -347,7 +358,7 @@ namespace Xceed.Wpf.Toolkit
var stringValues = currentValue.Split( new char[] { ':', '.' } );
if( ( stringValues.Count() >= 2 ) && !stringValues.Any( x => string.IsNullOrEmpty( x ) ) )
{
bool haveDays = (separators.First() == '.') && ( stringValues.Count() >= 3);
bool haveDays = ( separators.First() == '.' ) && ( stringValues.Count() >= 3 );
bool haveMS = ( separators.Count() > 1 ) && ( separators.Last() == '.' );
var values = new int[ stringValues.Count() ];
@ -359,11 +370,11 @@ namespace Xceed.Wpf.Toolkit
}
}
var days = haveDays ? Math.Abs( values[ 0 ] ): 0;
var days = haveDays ? Math.Abs( values[ 0 ] ) : 0;
if( days > TimeSpan.MaxValue.Days )
return;
var hours = haveDays ? Math.Abs( values[ 1 ] ) : Math.Abs( values[ 0 ] );
if( ( ( days * TimeSpanUpDown.HoursInDay ) + hours) > TimeSpan.MaxValue.TotalHours )
if( ( ( days * TimeSpanUpDown.HoursInDay ) + hours ) > TimeSpan.MaxValue.TotalHours )
return;
var minutes = haveDays ? Math.Abs( values[ 2 ] ) : Math.Abs( values[ 1 ] );
if( ( ( days * TimeSpanUpDown.MinutesInDay ) + ( hours * TimeSpanUpDown.MinutesInHour ) + minutes ) > TimeSpan.MaxValue.TotalMinutes )
@ -372,7 +383,7 @@ namespace Xceed.Wpf.Toolkit
if( ( ( days * TimeSpanUpDown.SecondsInDay ) + ( hours * TimeSpanUpDown.SecondsInHour ) + ( minutes * TimeSpanUpDown.SecondsInMinute ) + seconds ) > TimeSpan.MaxValue.TotalSeconds )
return;
var milliseconds = haveMS ? Math.Abs( values.Last() ) : 0;
if( ( ( days * TimeSpanUpDown.MilliSecondsInDay ) + ( hours * TimeSpanUpDown.MilliSecondsInHour ) + (minutes * TimeSpanUpDown.MilliSecondsInMinute ) + (seconds * TimeSpanUpDown.MilliSecondsInSecond ) + milliseconds ) > TimeSpan.MaxValue.TotalMilliseconds )
if( ( ( days * TimeSpanUpDown.MilliSecondsInDay ) + ( hours * TimeSpanUpDown.MilliSecondsInHour ) + ( minutes * TimeSpanUpDown.MilliSecondsInMinute ) + ( seconds * TimeSpanUpDown.MilliSecondsInSecond ) + milliseconds ) > TimeSpan.MaxValue.TotalMilliseconds )
return;
result = new TimeSpan( days, hours, minutes, seconds, milliseconds );
@ -391,7 +402,7 @@ namespace Xceed.Wpf.Toolkit
var previousValues = ( previousValue != null ) ? previousValue.Split( new char[] { ':', '.' } ) : null;
var currentValues = ( currentValue != null ) ? currentValue.Split( new char[] { ':', '.' } ) : null;
var canSync = ( previousValues != null )
var canSync = ( previousValues != null )
&& ( currentValues != null )
&& ( previousValues.Length == currentValues.Length ) // same number of time parts.
&& ( currentValue.Length == previousValue.Length ); // same number of digits.
@ -410,7 +421,7 @@ namespace Xceed.Wpf.Toolkit
if( newValue != null )
{
var value = this.UpdateValueOnEnterKey
? (this.TextBox != null) ? this.ConvertTextToValue( this.TextBox.Text ) : null
? ( this.TextBox != null ) ? this.ConvertTextToValue( this.TextBox.Text ) : null
: this.Value;
this.InitializeDateTimeInfoList( value );
}
@ -425,9 +436,10 @@ namespace Xceed.Wpf.Toolkit
this.InitializeDateTimeInfoList( this.Value );
}
var dateTimeInfo = (( _selectedDateTimeInfo == null ) && ( this.CurrentDateTimePart != DateTimePart.Other ))
var dateTimeInfo = ( ( _selectedDateTimeInfo == null ) && ( this.CurrentDateTimePart != DateTimePart.Other ) )
? this.GetDateTimeInfo( this.CurrentDateTimePart )
: this.GetDateTimeInfo( TextBox.SelectionStart );
if( ( dateTimeInfo != null ) && ( dateTimeInfo.Type == DateTimePart.Other ) )
{
// Select the next dateTime part
@ -443,7 +455,7 @@ namespace Xceed.Wpf.Toolkit
var lastDayInfo = _dateTimeInfoList.FirstOrDefault( x => x.Type == DateTimePart.Day );
bool hasDay = lastDayInfo != null;
var negInfo = _dateTimeInfoList.FirstOrDefault( x => x.Type == DateTimePart.Other );
bool hasNegative = (negInfo != null) && (negInfo.Content == "-");
bool hasNegative = ( negInfo != null ) && ( negInfo.Content == "-" );
_dateTimeInfoList.Clear();
@ -451,7 +463,7 @@ namespace Xceed.Wpf.Toolkit
{
_dateTimeInfoList.Add( new DateTimeInfo() { Type = DateTimePart.Other, Length = 1, Content = "-", IsReadOnly = true } );
// Negative has been added, move TextBox.Selection to keep it on current DateTimeInfo
if( !hasNegative && (this.TextBox != null) )
if( !hasNegative && ( this.TextBox != null ) )
{
_fireSelectionChangedEvent = false;
this.TextBox.SelectionStart++;
@ -461,10 +473,10 @@ namespace Xceed.Wpf.Toolkit
if( this.ShowDays )
{
if( value.HasValue)
if( value.HasValue )
{
int dayLength = Math.Abs( value.Value.Days ).ToString("00").Length;
_dateTimeInfoList.Add( new DateTimeInfo() { Type = DateTimePart.Day, Length = Math.Max(2, dayLength), Format = "dd" } );
int dayLength = Math.Abs( value.Value.Days ).ToString( "00" ).Length;
_dateTimeInfoList.Add( new DateTimeInfo() { Type = DateTimePart.Day, Length = Math.Max( 2, dayLength ), Format = "dd" } );
_dateTimeInfoList.Add( new DateTimeInfo() { Type = DateTimePart.Other, Length = 1, Content = ".", IsReadOnly = true } );
if( this.TextBox != null )
@ -526,7 +538,7 @@ namespace Xceed.Wpf.Toolkit
if( value1 == null || value2 == null )
return false;
return (value1.Value < value2.Value);
return ( value1.Value < value2.Value );
}
protected override bool IsGreaterThan( TimeSpan? value1, TimeSpan? value2 )
@ -534,7 +546,39 @@ namespace Xceed.Wpf.Toolkit
if( value1 == null || value2 == null )
return false;
return (value1.Value > value2.Value);
return ( value1.Value > value2.Value );
}
protected override object OnCurrentDateTimePartCoerce( object baseValue )
{
if( baseValue is DateTimePart )
{
var dateTimePart = ( DateTimePart )baseValue;
switch( dateTimePart )
{
case DateTimePart.Year:
case DateTimePart.Month:
case DateTimePart.MonthName:
case DateTimePart.Other:
case DateTimePart.Period:
case DateTimePart.TimeZone:
{
this.OnCurrentDateTimePartChanged( dateTimePart, DateTimePart.Day );
return DateTimePart.Day;
}
case DateTimePart.AmPmDesignator:
case DateTimePart.Hour12:
{
this.OnCurrentDateTimePartChanged( dateTimePart, DateTimePart.Hour24 );
return DateTimePart.Hour24;
}
default:
return baseValue;
}
}
return baseValue;
}
internal override void Select( DateTimeInfo info )
@ -666,9 +710,10 @@ namespace Xceed.Wpf.Toolkit
//this only occurs when the user manually type in a value for the Value Property
if( info == null )
{
info = (this.CurrentDateTimePart != DateTimePart.Other)
info = ( this.CurrentDateTimePart != DateTimePart.Other )
? this.GetDateTimeInfo( this.CurrentDateTimePart )
: (_dateTimeInfoList[ 0 ].Content != "-") ? _dateTimeInfoList[ 0 ] : _dateTimeInfoList[ 1 ]; //Skip negative sign
: ( _dateTimeInfoList[ 0 ].Content != "-" ) ? _dateTimeInfoList[ 0 ] : _dateTimeInfoList[ 1 ]; //Skip negative sign
if( info == null )
info = _dateTimeInfoList[ 0 ];
}
@ -680,16 +725,16 @@ namespace Xceed.Wpf.Toolkit
switch( info.Type )
{
case DateTimePart.Day:
result = ( ( TimeSpan )currentValue).Add( new TimeSpan( value, 0, 0, 0, 0 ) );
result = ( ( TimeSpan )currentValue ).Add( new TimeSpan( value, 0, 0, 0, 0 ) );
break;
case DateTimePart.Hour24:
result = ( ( TimeSpan )currentValue).Add( new TimeSpan( 0, value, 0, 0, 0 ) );
result = ( ( TimeSpan )currentValue ).Add( new TimeSpan( 0, value, 0, 0, 0 ) );
break;
case DateTimePart.Minute:
result = ( ( TimeSpan )currentValue).Add( new TimeSpan( 0, 0, value, 0, 0 ) );
result = ( ( TimeSpan )currentValue ).Add( new TimeSpan( 0, 0, value, 0, 0 ) );
break;
case DateTimePart.Second:
result = ( ( TimeSpan )currentValue).Add( new TimeSpan( 0, 0, 0, value, 0 ) );
result = ( ( TimeSpan )currentValue ).Add( new TimeSpan( 0, 0, 0, value, 0 ) );
break;
case DateTimePart.Millisecond:
switch( this.FractionalSecondsDigitsCount )
@ -704,7 +749,7 @@ namespace Xceed.Wpf.Toolkit
value = value * 1;
break;
}
result = ( ( TimeSpan )currentValue).Add( new TimeSpan( 0, 0, 0, 0, value ) );
result = ( ( TimeSpan )currentValue ).Add( new TimeSpan( 0, 0, 0, 0, value ) );
break;
default:
break;
@ -738,7 +783,7 @@ namespace Xceed.Wpf.Toolkit
? this.UpdateTimeSpan( currentValue, step )
: this.DefaultValue ?? TimeSpan.Zero;
if( newValue != null && ( _dateTimeInfoList != null) )
if( newValue != null && ( _dateTimeInfoList != null ) )
{
var selectionStart = 0;
var selectionLength = 0;
@ -768,24 +813,24 @@ namespace Xceed.Wpf.Toolkit
newTextBoxContent += dayText;
break;
case DateTimePart.Hour24:
var hourText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalHours ) ).ToString( new string( '0', timePartContentLength ) )
: Math.Abs( newValue.Value.Hours) .ToString( new string( '0', timePartContentLength ) );
var hourText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalHours ) ).ToString( new string( '0', timePartContentLength ) )
: Math.Abs( newValue.Value.Hours ).ToString( new string( '0', timePartContentLength ) );
timePart.StartPosition = newTextBoxContent.Length;
timePart.Length = hourText.Length;
newTextBoxContent += hourText;
break;
case DateTimePart.Minute:
var minuteText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalMinutes ) ).ToString( new string( '0', timePartContentLength ) )
var minuteText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalMinutes ) ).ToString( new string( '0', timePartContentLength ) )
: Math.Abs( newValue.Value.Minutes ).ToString( new string( '0', timePartContentLength ) );
timePart.StartPosition = newTextBoxContent.Length;
timePart.Length = minuteText.Length;
newTextBoxContent += minuteText;
break;
case DateTimePart.Second:
var secondText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalSeconds ) ).ToString( new string( '0', timePartContentLength ) )
var secondText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalSeconds ) ).ToString( new string( '0', timePartContentLength ) )
: Math.Abs( newValue.Value.Seconds ).ToString( new string( '0', timePartContentLength ) );
timePart.StartPosition = newTextBoxContent.Length;
timePart.Length = secondText.Length;
@ -793,7 +838,7 @@ namespace Xceed.Wpf.Toolkit
break;
case DateTimePart.Millisecond:
var millisecondText = ( i <= 1 )
? Math.Truncate( Math.Abs( newValue.Value.TotalMilliseconds ) ).ToString( new string( '0', timePartContentLength ) )
? Math.Truncate( Math.Abs( newValue.Value.TotalMilliseconds ) ).ToString( new string( '0', timePartContentLength ) )
: Math.Abs( newValue.Value.Milliseconds ).ToString( new string( '0', timePartContentLength ) );
timePart.StartPosition = newTextBoxContent.Length;
timePart.Length = millisecondText.Length;
@ -822,15 +867,19 @@ namespace Xceed.Wpf.Toolkit
var newValue = this.UpdateTimeSpan( this.Value, step );
if( newValue != null )
{
int selectionStart;
int selectionLength;
int selectionStart = 0;
int selectionLength = 0;
this.InitializeDateTimeInfoList( newValue );
if( ( _selectedDateTimeInfo == null ) && ( this.CurrentDateTimePart != DateTimePart.Other ) )
{
var currentDateTimeInfo = this.GetDateTimeInfo( this.CurrentDateTimePart );
selectionStart = currentDateTimeInfo.StartPosition;
selectionLength = currentDateTimeInfo.Length;
if( currentDateTimeInfo != null )
{
selectionStart = currentDateTimeInfo.StartPosition;
selectionLength = currentDateTimeInfo.Length;
}
}
else
{

1
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Themes/Aero2.NormalColor.xaml

@ -81,6 +81,7 @@
SpinnerUpDisabledContentTemplate="{TemplateBinding ButtonSpinnerUpDisabledContentTemplate}"
SpinnerDownDisabledContentTemplate="{TemplateBinding ButtonSpinnerDownDisabledContentTemplate}"
AllowSpin="{TemplateBinding AllowSpin}"
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}"
ShowSpinner="{TemplateBinding ShowButtonSpinner}">
<local:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save