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 style for LayoutAutoHideWindowControl's inner Grid #498

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ public Style AnchorableStyle

#endregion AnchorableStyle

#region AnchorableGridStyle

/// <summary><see cref="AnchorableGridStyle"/> dependency property.</summary>
public static readonly DependencyProperty AnchorableGridStyleProperty = DependencyProperty.Register(nameof(AnchorableGridStyle), typeof(Style), typeof(LayoutAutoHideWindowControl),
new FrameworkPropertyMetadata(null));

/// <summary>Gets/sets the style to apply to the parent Grid of the <see cref="LayoutAnchorableControl"/> hosted in this auto hide window.</summary>
[Bindable(true), Description("Gets/sets the style to apply to the parent Grid of the LayoutAnchorableControl hosted in this auto hide window."), Category("Style")]
public Style AnchorableGridStyle
{
get => (Style)GetValue(AnchorableGridStyleProperty);
set => SetValue(AnchorableGridStyleProperty, value);
}

#endregion AnchorableGridStyle

#region Background

/// <summary><see cref="Background"/> dependency property.</summary>
Expand Down Expand Up @@ -280,8 +296,9 @@ private void ViewboxZoomChanged(object sender, SizeChangedEventArgs e)

private void CreateInternalGrid()
{
_internalGrid = new Grid { FlowDirection = FlowDirection.LeftToRight };
_internalGrid = new Grid { FlowDirection = FlowDirection.LeftToRight, Style = AnchorableGridStyle };
_internalGrid.SetBinding(Panel.BackgroundProperty, new Binding(nameof(Grid.Background)) { Source = this });
_internalGrid.SizeChanged += (e, s) => InvalidateMeasure();

_internalHost = new LayoutAnchorableControl { Model = _model, Style = AnchorableStyle };
_internalHost.SetBinding(FlowDirectionProperty, new Binding("Model.Root.Manager.FlowDirection") { Source = this });
Expand Down