Skip to content

Commit

Permalink
Implement PanelMaterial prop to NavigationView
Browse files Browse the repository at this point in the history
  • Loading branch information
PieroCastillo committed Aug 2, 2021
1 parent 52d2f69 commit 8807d6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Aura.UI.FluentTheme/Controls/NavigationViewStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<Setter Property="CompactPaneLength" Value="{DynamicResource NavigationViewCompactPaneLength}" />
<Setter Property="OpenPaneLength" Value="{DynamicResource NavigationViewOpenPaneLength}" />
<Setter Property="Background" Value="{DynamicResource NavigationViewBackground}" />
<Setter Property="PanelMaterial" Value="{StaticResource NavigationViewMaterial}"/>
<Setter Property="Icon" Value="{DynamicResource line_horizontal_3_regular}" />
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
Expand All @@ -79,7 +80,8 @@
<SplitView.Pane>
<Border Name="PART_ShadowBorder">
<ExperimentalAcrylicBorder Name="PART_AcrylicBorder"
Padding="0,0">
Padding="0,0"
Material="{Binding $parent[NavigationView].PanelMaterial}">
<Grid RowDefinitions="auto,auto,auto,*">
<Border Grid.Row="1"
Width="{Binding $parent[NavigationView].CompactPaneLength}"
Expand Down Expand Up @@ -172,10 +174,6 @@
<Style Selector="NavigationView /template/ Border#PART_ShadowBorder">
<Setter Property="BoxShadow" Value="0 0 50 0 Black"/>
</Style>

<Style Selector="NavigationView ExperimentalAcrylicBorder#PART_AcrylicBorder">
<Setter Property="Material" Value="{StaticResource NavigationViewMaterial}" />
</Style>

<Style Selector="NavigationView[IsOpen=true] /template/ ExperimentalAcrylicBorder#PART_AcrylicBorder">
<Setter Property="Width" Value="{Binding $parent[NavigationView].OpenPaneLength}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public partial class NavigationView
public readonly static StyledProperty<bool> AutoCompleteBoxIsVisibleProperty =
AvaloniaProperty.Register<NavigationView, bool>(nameof(AutoCompleteBoxIsVisible), true);

public readonly static StyledProperty<ExperimentalAcrylicMaterial> PanelMaterialProperty =
AvaloniaProperty.Register<NavigationView, ExperimentalAcrylicMaterial>(nameof(PanelMaterial));

public readonly static DirectProperty<NavigationView, IEnumerable<string>> ItemsAsStringsProperty =
AvaloniaProperty.RegisterDirect<NavigationView, IEnumerable<string>>(nameof(ItemsAsStrings), o => o.ItemsAsStrings);

Expand All @@ -79,6 +82,12 @@ public IImage Icon
set => SetValue(IconProperty, value);
}

public ExperimentalAcrylicMaterial PanelMaterial
{
get => GetValue(PanelMaterialProperty);
set => SetValue(PanelMaterialProperty, value);
}


public object Title
{
Expand Down

0 comments on commit 8807d6f

Please sign in to comment.