feat: wow, first prototype of navigation menu.

This commit is contained in:
rabbitism
2023-06-22 22:00:28 +08:00
parent f4bb4d379e
commit bacf1a6330
9 changed files with 322 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:NavigationMenu}" TargetType="u:NavigationMenu">
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenu">
<Border Background="{TemplateBinding Background}">
<StackPanel>
<ContentPresenter Name="PART_HeaderPresenter" Content="Hello" />
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</StackPanel>
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:NavigationMenuItem}" TargetType="u:NavigationMenuItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate TargetType="u:NavigationMenuItem">
<Border
Padding="4"
BorderBrush="Black"
BorderThickness="1">
<StackPanel>
<ContentPresenter
Name="PART_HeaderPresenter"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}" />
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</StackPanel>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:selected">
<Setter Property="u:NavigationMenuItem.Background" Value="Red" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -5,6 +5,7 @@
<ResourceInclude Source="Banner.axaml" />
<ResourceInclude Source="Divider.axaml" />
<ResourceInclude Source="IPv4Box.axaml" />
<ResourceInclude Source="Navigation.axaml" />
<ResourceInclude Source="Pagination.axaml" />
<ResourceInclude Source="Timeline.axaml" />
</ResourceDictionary.MergedDictionaries>