|
|
@ -1,6 +1,6 @@ |
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
xmlns:catalog="using:ControlSamples"> |
|
|
xmlns:catalog="using:ControlSamples"> |
|
|
<Design.PreviewWith> |
|
|
<Design.PreviewWith> |
|
|
<Border Width="400" |
|
|
<Border Width="400" |
|
|
Height="150"> |
|
|
Height="150"> |
|
|
@ -20,21 +20,84 @@ |
|
|
</Border> |
|
|
</Border> |
|
|
</Design.PreviewWith> |
|
|
</Design.PreviewWith> |
|
|
|
|
|
|
|
|
<Styles.Resources> |
|
|
<x:Double x:Key="PaneCompactWidth">40</x:Double> |
|
|
<x:Double x:Key="PaneCompactWidth">40</x:Double> |
|
|
<x:Double x:Key="PaneExpandWidth">220</x:Double> |
|
|
<x:Double x:Key="PaneExpandWidth">220</x:Double> |
|
|
<x:Double x:Key="HeaderHeight">36</x:Double> |
|
|
<x:Double x:Key="HeaderHeight">36</x:Double> |
|
|
<x:Double x:Key="NavigationItemHeight">36</x:Double> |
|
|
<x:Double x:Key="NavigationItemHeight">36</x:Double> |
|
|
<x:Double x:Key="HamburgerMenuButtonHeight">32</x:Double> |
|
|
<x:Double x:Key="HamburgerMenuButtonHeight">32</x:Double> |
|
|
<Thickness x:Key="HeaderMarginCollapsedPane">12,0,0,0</Thickness> |
|
|
<Thickness x:Key="HeaderMarginCollapsedPane">12,0,0,0</Thickness> |
|
|
<Thickness x:Key="HeaderMarginExpandedPane">52,0,0,0</Thickness> |
|
|
<Thickness x:Key="HeaderMarginExpandedPane">52,0,0,0</Thickness> |
|
|
<Thickness x:Key="HeaderMarginExpandedOverlayPane">212,0,0,0</Thickness> |
|
|
<Thickness x:Key="HeaderMarginExpandedOverlayPane">212,0,0,0</Thickness> |
|
|
<BoxShadows x:Key="NavigationItemShadow">1 1 1 1 #2000, 0 0 1 1 #2fff</BoxShadows> |
|
|
<BoxShadows x:Key="NavigationItemShadow">1 1 1 1 #2000, 0 0 1 1 #2fff</BoxShadows> |
|
|
<BoxShadows x:Key="NavigationContentShadow">0 0 1 1 #2000</BoxShadows> |
|
|
<BoxShadows x:Key="NavigationContentShadow">0 0 1 1 #2000</BoxShadows> |
|
|
|
|
|
</Styles.Resources> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ControlTheme x:Key="NavigationButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"> |
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|
|
|
|
|
<Setter Property="FontWeight" Value="Normal" /> |
|
|
|
|
|
<Setter Property="MinHeight" Value="0" /> |
|
|
|
|
|
<Setter Property="Height" Value="{StaticResource NavigationItemHeight}" /> |
|
|
|
|
|
<Setter Property="Background" Value="Transparent" /> |
|
|
|
|
|
<Setter Property="Padding" Value="12,0,4,0" /> |
|
|
|
|
|
<Setter Property="Margin" Value="4,0,8,0" /> |
|
|
|
|
|
<Setter Property="CornerRadius" Value="8" /> |
|
|
|
|
|
<Setter Property="ClipToBounds" Value="False" /> |
|
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
|
<ControlTemplate> |
|
|
|
|
|
<ContentPresenter Name="PART_ContentPresenter" |
|
|
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
|
|
Content="{TemplateBinding Content}" |
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}" |
|
|
|
|
|
TextElement.FontFamily="{TemplateBinding FontFamily}" |
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}" |
|
|
|
|
|
TextElement.FontWeight="{TemplateBinding FontWeight}" /> |
|
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
</Setter> |
|
|
|
|
|
</ControlTheme> |
|
|
|
|
|
|
|
|
|
|
|
<ControlTheme x:Key="HamburgerMenuTabItem" TargetType="TabItem"> |
|
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
|
<ControlTemplate> |
|
|
|
|
|
<Border Name="PART_LayoutRoot" |
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|
|
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"> |
|
|
|
|
|
<Panel> |
|
|
|
|
|
<Border Name="PART_SelectedPipe" |
|
|
|
|
|
Width="{DynamicResource TabItemPipeThickness}" |
|
|
|
|
|
Height="{DynamicResource TabItemVerticalPipeHeight}" |
|
|
|
|
|
Margin="6,0,0,0" |
|
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
|
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|
|
|
|
|
<ContentPresenter Name="PART_ContentPresenter" |
|
|
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
|
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|
|
|
|
|
TextElement.FontFamily="{TemplateBinding FontFamily}" |
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}" |
|
|
|
|
|
TextElement.FontWeight="{TemplateBinding FontWeight}" /> |
|
|
|
|
|
</Panel> |
|
|
|
|
|
</Border> |
|
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
</Setter> |
|
|
|
|
|
</ControlTheme> |
|
|
|
|
|
|
|
|
<!-- HamburgerMenu --> |
|
|
<!-- HamburgerMenu --> |
|
|
<Style Selector="catalog|HamburgerMenu"> |
|
|
<ControlTheme x:Key="{x:Type catalog:HamburgerMenu}" TargetType="catalog:HamburgerMenu"> |
|
|
<Setter Property="Padding" Value="12 8 4 0" /> |
|
|
<Setter Property="Padding" Value="12 8 4 0" /> |
|
|
<Setter Property="PaneBackground" Value="{DynamicResource SystemChromeMediumColor}" /> |
|
|
<Setter Property="PaneBackground" Value="{DynamicResource SystemChromeMediumColor}" /> |
|
|
<Setter Property="Background" Value="{DynamicResource SystemChromeMediumColor}" /> |
|
|
<Setter Property="Background" Value="{DynamicResource SystemChromeMediumColor}" /> |
|
|
@ -60,6 +123,11 @@ |
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
Items="{TemplateBinding Items}" |
|
|
Items="{TemplateBinding Items}" |
|
|
ItemsPanel="{TemplateBinding ItemsPanel}"> |
|
|
ItemsPanel="{TemplateBinding ItemsPanel}"> |
|
|
|
|
|
<ItemsPresenter.Styles> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem"> |
|
|
|
|
|
<Setter Property="Theme" Value="{StaticResource HamburgerMenuTabItem}"/> |
|
|
|
|
|
</Style> |
|
|
|
|
|
</ItemsPresenter.Styles> |
|
|
<ItemsPresenter.ItemsPanel> |
|
|
<ItemsPresenter.ItemsPanel> |
|
|
<ItemsPanelTemplate> |
|
|
<ItemsPanelTemplate> |
|
|
<StackPanel x:Name="HamburgerItemsPanel" |
|
|
<StackPanel x:Name="HamburgerItemsPanel" |
|
|
@ -70,7 +138,7 @@ |
|
|
</ScrollViewer> |
|
|
</ScrollViewer> |
|
|
<Button x:Name="SettingsButton" |
|
|
<Button x:Name="SettingsButton" |
|
|
Grid.Row="2" |
|
|
Grid.Row="2" |
|
|
Classes="NavigationButton" |
|
|
Theme="{StaticResource NavigationButton}" |
|
|
Content="Settings" |
|
|
Content="Settings" |
|
|
Flyout="{TemplateBinding (FlyoutBase.AttachedFlyout)}" |
|
|
Flyout="{TemplateBinding (FlyoutBase.AttachedFlyout)}" |
|
|
IsVisible="{Binding $parent[TabControl].(FlyoutBase.AttachedFlyout), Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|
|
IsVisible="{Binding $parent[TabControl].(FlyoutBase.AttachedFlyout), Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|
|
@ -127,116 +195,52 @@ |
|
|
</Panel> |
|
|
</Panel> |
|
|
</ControlTemplate> |
|
|
</ControlTemplate> |
|
|
</Setter> |
|
|
</Setter> |
|
|
</Style> |
|
|
|
|
|
|
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView TextBlock#HeaderHolder"> |
|
|
<Style Selector="^ /template/ SplitView TextBlock#HeaderHolder"> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginExpandedPane}" /> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginExpandedPane}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[IsPaneOpen=True] TextBlock#HeaderHolder"> |
|
|
<Style Selector="^ /template/ SplitView[IsPaneOpen=True] TextBlock#HeaderHolder"> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginCollapsedPane}" /> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginCollapsedPane}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[DisplayMode=Overlay][IsPaneOpen=True] TextBlock#HeaderHolder"> |
|
|
<Style Selector="^ /template/ SplitView[DisplayMode=Overlay][IsPaneOpen=True] TextBlock#HeaderHolder"> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginExpandedOverlayPane}" /> |
|
|
<Setter Property="Margin" Value="{StaticResource HeaderMarginExpandedOverlayPane}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView"> |
|
|
<Style Selector="^ /template/ SplitView"> |
|
|
<Setter Property="PaneBackground" Value="Transparent" /> |
|
|
<Setter Property="PaneBackground" Value="Transparent" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[DisplayMode=Overlay]"> |
|
|
<Style Selector="^ /template/ SplitView[DisplayMode=Overlay]"> |
|
|
<Setter Property="PaneBackground" Value="{TemplateBinding PaneBackground}" /> |
|
|
<Setter Property="PaneBackground" Value="{TemplateBinding PaneBackground}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[DisplayMode=Overlay]"> |
|
|
<Style Selector="^ /template/ SplitView[DisplayMode=Overlay]"> |
|
|
<Setter Property="Background" Value="{Binding $parent[TabControl].ContentBackground}" /> |
|
|
<Setter Property="Background" Value="{Binding $parent[TabControl].ContentBackground}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[DisplayMode=Inline] Border#BackgroundBorder"> |
|
|
<Style Selector="^ /template/ SplitView[DisplayMode=Inline] Border#BackgroundBorder"> |
|
|
<Setter Property="Background" Value="{Binding $parent[TabControl].ContentBackground}" /> |
|
|
<Setter Property="Background" Value="{Binding $parent[TabControl].ContentBackground}" /> |
|
|
<Setter Property="BoxShadow" Value="{StaticResource NavigationContentShadow}" /> |
|
|
<Setter Property="BoxShadow" Value="{StaticResource NavigationContentShadow}" /> |
|
|
</Style> |
|
|
</Style> |
|
|
<Style Selector="catalog|HamburgerMenu /template/ SplitView[DisplayMode=Inline][IsPaneOpen=True] Border#BackgroundBorder"> |
|
|
<Style Selector="^ /template/ SplitView[DisplayMode=Inline][IsPaneOpen=True] Border#BackgroundBorder"> |
|
|
<Setter Property="CornerRadius" Value="8 0 0 0" /> |
|
|
<Setter Property="CornerRadius" Value="8 0 0 0" /> |
|
|
</Style> |
|
|
</Style> |
|
|
|
|
|
<!--<Style Selector="^ > TabItem"> |
|
|
|
|
|
|
|
|
|
|
|
</Style>--> |
|
|
|
|
|
<!--<Style Selector="^ > TabItem /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="Transparent" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource SystemBaseHighColor}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="^ > TabItem:pointerover /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton:pointerover /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="{DynamicResource SystemChromeLowColor}" /> |
|
|
|
|
|
<Setter Property="Border.BoxShadow" Value="{StaticResource NavigationItemShadow}" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="^ > TabItem:pressed /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton:pressed /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="{DynamicResource SystemChromeLowColor}" /> |
|
|
|
|
|
<Setter Property="Border.BoxShadow" Value="{StaticResource NavigationItemShadow}" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector=":is(Button).NavigationButton:pressed"> |
|
|
|
|
|
<Setter Property="RenderTransform" Value="none" /> |
|
|
|
|
|
</Style>--> |
|
|
|
|
|
</ControlTheme> |
|
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary> |
|
|
<!-- HamburgerMenu TabItem --> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem, :is(Button).NavigationButton"> |
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|
|
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|
|
|
|
|
<Setter Property="FontWeight" Value="Normal" /> |
|
|
|
|
|
<Setter Property="MinHeight" Value="0" /> |
|
|
|
|
|
<Setter Property="Height" Value="{StaticResource NavigationItemHeight}" /> |
|
|
|
|
|
<Setter Property="Background" Value="Transparent" /> |
|
|
|
|
|
<Setter Property="Padding" Value="12,0,4,0" /> |
|
|
|
|
|
<Setter Property="Margin" Value="4,0,8,0" /> |
|
|
|
|
|
<Setter Property="CornerRadius" Value="8" /> |
|
|
|
|
|
<Setter Property="ClipToBounds" Value="False" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem"> |
|
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
|
<ControlTemplate> |
|
|
|
|
|
<Border Name="PART_LayoutRoot" |
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|
|
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"> |
|
|
|
|
|
<Panel> |
|
|
|
|
|
<Border Name="PART_SelectedPipe" |
|
|
|
|
|
Width="{DynamicResource TabItemPipeThickness}" |
|
|
|
|
|
Height="{DynamicResource TabItemVerticalPipeHeight}" |
|
|
|
|
|
Margin="6,0,0,0" |
|
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
|
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|
|
|
|
|
<ContentPresenter Name="PART_ContentPresenter" |
|
|
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
|
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|
|
|
|
|
TextElement.FontFamily="{TemplateBinding FontFamily}" |
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}" |
|
|
|
|
|
TextElement.FontWeight="{TemplateBinding FontWeight}" /> |
|
|
|
|
|
</Panel> |
|
|
|
|
|
</Border> |
|
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
</Setter> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector=":is(Button).NavigationButton"> |
|
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
|
<ControlTemplate> |
|
|
|
|
|
<ContentPresenter Name="PART_ContentPresenter" |
|
|
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
|
|
Content="{TemplateBinding Content}" |
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}" |
|
|
|
|
|
TextElement.FontFamily="{TemplateBinding FontFamily}" |
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}" |
|
|
|
|
|
TextElement.FontWeight="{TemplateBinding FontWeight}" /> |
|
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
</Setter> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="Transparent" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource SystemBaseHighColor}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem:pointerover /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton:pointerover /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="{DynamicResource SystemChromeLowColor}" /> |
|
|
|
|
|
<Setter Property="Border.BoxShadow" Value="{StaticResource NavigationItemShadow}" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector="catalog|HamburgerMenu > TabItem:pressed /template/ Border#PART_LayoutRoot, :is(Button).NavigationButton:pressed /template/ ContentPresenter"> |
|
|
|
|
|
<Setter Property="Border.Background" Value="{DynamicResource SystemChromeLowColor}" /> |
|
|
|
|
|
<Setter Property="Border.BoxShadow" Value="{StaticResource NavigationItemShadow}" /> |
|
|
|
|
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
<Style Selector=":is(Button).NavigationButton:pressed"> |
|
|
|
|
|
<Setter Property="RenderTransform" Value="none" /> |
|
|
|
|
|
</Style> |
|
|
|
|
|
</Styles> |
|
|
|
|
|
|