Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom styles for LayoutGridResizerControl #274

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion source/Components/AvalonDock/Controls/LayoutGridControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
53 changes: 53 additions & 0 deletions source/Components/AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,59 @@ public double GridSplitterHeight

#endregion GridSplitterHeight

#region GridSplitterVerticalStyle

/// <summary>
/// GridSplitterVerticalStyle Dependency Property
/// </summary>
public static readonly DependencyProperty GridSplitterVerticalStyleProperty = DependencyProperty.Register("GridSplitterVerticalStyle", typeof(Style), typeof(DockingManager),
new FrameworkPropertyMetadata((Style)null));

/// <summary>
/// Gets or sets the GridSplitterVerticalStyle property. This dependency property
/// indicates the style to apply to the LayoutGridResizerControl when displayed vertically.
/// </summary>
public Style GridSplitterVerticalStyle
{
get
{
return (Style)GetValue(GridSplitterVerticalStyleProperty);
}
set
{
SetValue(GridSplitterVerticalStyleProperty, value);
}
}

#endregion

#region GridSplitterHorizontalStyle

/// <summary>
/// GridSplitterHorizontalStyle Dependency Property
/// </summary>
public static readonly DependencyProperty GridSplitterHorizontalStyleProperty = DependencyProperty.Register("GridSplitterHorizontalStyle", typeof(Style), typeof(DockingManager),
new FrameworkPropertyMetadata((Style)null));

/// <summary>
/// Gets or sets the GridSplitterHorizontalStyle property. This dependency property
/// indicates the style to apply to the LayoutGridResizerControl when displayed horizontally.
/// </summary>
public Style GridSplitterHorizontalStyle
{
get
{
return (Style)GetValue(GridSplitterHorizontalStyleProperty);
}
set
{
SetValue(GridSplitterHorizontalStyleProperty, value);
}
}

#endregion


#region DocumentPaneMenuItemHeaderTemplate

/// <summary><see cref="DocumentPaneMenuItemHeaderTemplate"/> dependency property.</summary>
Expand Down