From 392ca526b581ea0ad91ceb37a1af9033afa7dc72 Mon Sep 17 00:00:00 2001
From: Michele Pondo <565423+mpondo@users.noreply.github.com>
Date: Mon, 3 May 2021 18:33:08 +0000
Subject: [PATCH] Support styles for LayoutGridResizerControl
---
.../AvalonDock/Controls/LayoutGridControl.cs | 16 +++++-
.../Components/AvalonDock/DockingManager.cs | 53 +++++++++++++++++++
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/source/Components/AvalonDock/Controls/LayoutGridControl.cs b/source/Components/AvalonDock/Controls/LayoutGridControl.cs
index 09399daa..c8a87860 100644
--- a/source/Components/AvalonDock/Controls/LayoutGridControl.cs
+++ b/source/Components/AvalonDock/Controls/LayoutGridControl.cs
@@ -290,7 +290,21 @@ private void CreateSplitters()
{
for (var iChild = 1; iChild < Children.Count; iChild++)
{
- Children.Insert(iChild, new LayoutGridResizerControl { Cursor = this.Orientation == Orientation.Horizontal ? Cursors.SizeWE : Cursors.SizeNS });
+ var splitter = new LayoutGridResizerControl();
+
+ if (Orientation == Orientation.Horizontal)
+ {
+ splitter.Cursor = Cursors.SizeWE;
+ splitter.Style = _model.Root?.Manager?.GridSplitterVerticalStyle;
+ }
+ else
+ {
+ splitter.Cursor = Cursors.SizeNS;
+ splitter.Style = _model.Root?.Manager?.GridSplitterHorizontalStyle;
+ }
+
+
+ Children.Insert(iChild, splitter);
// TODO: MK Is this a bug????
iChild++;
}
diff --git a/source/Components/AvalonDock/DockingManager.cs b/source/Components/AvalonDock/DockingManager.cs
index f7819482..3b5f2f16 100644
--- a/source/Components/AvalonDock/DockingManager.cs
+++ b/source/Components/AvalonDock/DockingManager.cs
@@ -1104,6 +1104,59 @@ public double GridSplitterHeight
#endregion GridSplitterHeight
+ #region GridSplitterVerticalStyle
+
+ ///
+ /// GridSplitterVerticalStyle Dependency Property
+ ///
+ public static readonly DependencyProperty GridSplitterVerticalStyleProperty = DependencyProperty.Register("GridSplitterVerticalStyle", typeof(Style), typeof(DockingManager),
+ new FrameworkPropertyMetadata((Style)null));
+
+ ///
+ /// Gets or sets the GridSplitterVerticalStyle property. This dependency property
+ /// indicates the style to apply to the LayoutGridResizerControl when displayed vertically.
+ ///
+ public Style GridSplitterVerticalStyle
+ {
+ get
+ {
+ return (Style)GetValue(GridSplitterVerticalStyleProperty);
+ }
+ set
+ {
+ SetValue(GridSplitterVerticalStyleProperty, value);
+ }
+ }
+
+ #endregion
+
+ #region GridSplitterHorizontalStyle
+
+ ///
+ /// GridSplitterHorizontalStyle Dependency Property
+ ///
+ public static readonly DependencyProperty GridSplitterHorizontalStyleProperty = DependencyProperty.Register("GridSplitterHorizontalStyle", typeof(Style), typeof(DockingManager),
+ new FrameworkPropertyMetadata((Style)null));
+
+ ///
+ /// Gets or sets the GridSplitterHorizontalStyle property. This dependency property
+ /// indicates the style to apply to the LayoutGridResizerControl when displayed horizontally.
+ ///
+ public Style GridSplitterHorizontalStyle
+ {
+ get
+ {
+ return (Style)GetValue(GridSplitterHorizontalStyleProperty);
+ }
+ set
+ {
+ SetValue(GridSplitterHorizontalStyleProperty, value);
+ }
+ }
+
+ #endregion
+
+
#region DocumentPaneMenuItemHeaderTemplate
/// dependency property.