mirror of
https://github.com/amwx/FluentAvalonia.git
synced 2026-10-17 04:30:38 +08:00
Page system support
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<Border Width="400" Height="300">
|
||||
<CarouselPage>
|
||||
<ContentPage Header="Page 1">
|
||||
<TextBlock Text="First page" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
<ContentPage Header="Page 2">
|
||||
<TextBlock Text="Second page" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
</CarouselPage>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type CarouselPage}" TargetType="CarouselPage">
|
||||
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Carousel Name="PART_Carousel"
|
||||
Background="{TemplateBinding Background}"
|
||||
ItemTemplate="{TemplateBinding PageTemplate}"
|
||||
PageTransition="{TemplateBinding PageTransition}"
|
||||
ItemsPanel="{TemplateBinding ItemsPanel}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,44 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<ContentPage Header="Sample Page">
|
||||
<TextBlock Text="Content goes here"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type ContentPage}" TargetType="ContentPage">
|
||||
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DockPanel>
|
||||
<!-- Visibility managed in code-behind -->
|
||||
<ContentPresenter Name="PART_TopCommandBar"
|
||||
DockPanel.Dock="Top"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
IsVisible="False" />
|
||||
|
||||
<!-- Visibility managed in code-behind -->
|
||||
<ContentPresenter Name="PART_BottomCommandBar"
|
||||
DockPanel.Dock="Bottom"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
IsVisible="False" />
|
||||
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,259 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<Border Width="400" Height="400" Padding="20" Background="DarkGray">
|
||||
<DrawerPage Header="Sample Drawer Page"
|
||||
DrawerLength="200"
|
||||
IsOpen="False">
|
||||
<ContentPage Header="Drawer Content">
|
||||
<TextBlock Text="Drawer menu" />
|
||||
</ContentPage>
|
||||
</DrawerPage>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ui:FASymbolIconSource x:Key="DrawerPageNavIcon" Symbol="Navigation" FontSize="20" />
|
||||
|
||||
<x:Double x:Key="NavigationControlNavBarHeight">48</x:Double>
|
||||
<SolidColorBrush x:Key="NavigationControlNavBarBackground" Color="{DynamicResource LayerFillColorDefault}" />
|
||||
|
||||
|
||||
<ControlTheme x:Key="{x:Type DrawerPage}" TargetType="DrawerPage">
|
||||
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<SplitView Name="PART_SplitView"
|
||||
DisplayMode="{TemplateBinding DisplayMode}"
|
||||
OpenPaneLength="{TemplateBinding DrawerLength}"
|
||||
CompactPaneLength="{TemplateBinding CompactDrawerLength}"
|
||||
PaneBackground="{Binding DrawerBackground, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
IsPaneOpen="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
||||
<SplitView.Pane>
|
||||
<DockPanel Background="{TemplateBinding DrawerBackground}">
|
||||
<!-- Compact-mode toggle: visible only in CompactOverlay/CompactInline. -->
|
||||
<ToggleButton Name="PART_CompactPaneToggle"
|
||||
DockPanel.Dock="Top"
|
||||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||
Background="Transparent"
|
||||
IsVisible="False"
|
||||
HorizontalAlignment="Left"
|
||||
Width="{TemplateBinding CompactDrawerLength}"
|
||||
Height="{TemplateBinding CompactDrawerLength}"
|
||||
AutomationProperties.Name="Toggle navigation drawer"
|
||||
ToolTip.Tip="Toggle navigation drawer"
|
||||
Theme="{StaticResource TransparentToggleButton}">
|
||||
<Panel>
|
||||
<ui:FAIconSourceElement IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}"
|
||||
IconSource="{DynamicResource DrawerPageNavIcon}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<ContentPresenter Name="PART_CompactPaneIconPresenter"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Panel>
|
||||
</ToggleButton>
|
||||
<ContentPresenter Name="PART_DrawerHeader"
|
||||
DockPanel.Dock="Top"
|
||||
Content="{TemplateBinding DrawerHeader}"
|
||||
ContentTemplate="{TemplateBinding DrawerHeaderTemplate}"
|
||||
Background="{TemplateBinding DrawerHeaderBackground}"
|
||||
IsVisible="{TemplateBinding DrawerHeader, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<ContentPresenter Name="PART_DrawerFooter"
|
||||
DockPanel.Dock="Bottom"
|
||||
Content="{TemplateBinding DrawerFooter}"
|
||||
ContentTemplate="{TemplateBinding DrawerFooterTemplate}"
|
||||
Background="{TemplateBinding DrawerFooterBackground}"
|
||||
IsVisible="{TemplateBinding DrawerFooter, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<ContentPresenter Name="PART_DrawerPresenter"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding Drawer}"
|
||||
ContentTemplate="{TemplateBinding DrawerTemplate}" />
|
||||
</DockPanel>
|
||||
</SplitView.Pane>
|
||||
|
||||
<Grid HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
<DockPanel Name="PART_ContentDock">
|
||||
<Border Name="PART_TopBar"
|
||||
Padding="5"
|
||||
Height="{DynamicResource NavigationControlNavBarHeight}"
|
||||
Background="{DynamicResource NavigationControlNavBarBackground}"
|
||||
DockPanel.Dock="Top">
|
||||
<DockPanel HorizontalAlignment="Stretch">
|
||||
<DockPanel.Styles>
|
||||
<Styles>
|
||||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
</Style>
|
||||
</Styles>
|
||||
</DockPanel.Styles>
|
||||
<ToggleButton Name="PART_PaneButton"
|
||||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||
Background="Transparent"
|
||||
DockPanel.Dock="Left"
|
||||
AutomationProperties.Name="Toggle navigation drawer"
|
||||
ToolTip.Tip="Toggle navigation drawer"
|
||||
Theme="{StaticResource TransparentToggleButton}">
|
||||
<Panel>
|
||||
<ui:FAIconSourceElement IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}"
|
||||
IconSource="{DynamicResource DrawerPageNavIcon}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<ContentPresenter Name="PART_PaneIconPresenter"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Panel>
|
||||
</ToggleButton>
|
||||
<ContentControl Name="PART_TitlePresenter"
|
||||
Content="{TemplateBinding Header}"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Margin="8,0,0,0"
|
||||
IsVisible="{TemplateBinding Header, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<Border Name="PART_BottomBar"
|
||||
Padding="5"
|
||||
Height="{DynamicResource NavigationControlNavBarHeight}"
|
||||
Background="{DynamicResource NavigationControlNavBarBackground}"
|
||||
DockPanel.Dock="Bottom"
|
||||
IsVisible="False">
|
||||
<DockPanel HorizontalAlignment="Stretch">
|
||||
<DockPanel.Styles>
|
||||
<Styles>
|
||||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
</Style>
|
||||
</Styles>
|
||||
</DockPanel.Styles>
|
||||
<ToggleButton Name="PART_BottomPaneButton"
|
||||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}"
|
||||
Background="Transparent"
|
||||
DockPanel.Dock="Left"
|
||||
AutomationProperties.Name="Toggle navigation drawer"
|
||||
ToolTip.Tip="Toggle navigation drawer"
|
||||
Theme="{StaticResource TransparentToggleButton}">
|
||||
<Panel>
|
||||
<ui:FAIconSourceElement IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}"
|
||||
IconSource="{DynamicResource DrawerPageNavIcon}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<ContentPresenter Name="PART_BottomPaneIconPresenter"
|
||||
Content="{TemplateBinding DrawerIcon}"
|
||||
ContentTemplate="{TemplateBinding DrawerIconTemplate}"
|
||||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Panel>
|
||||
</ToggleButton>
|
||||
<ContentControl Name="PART_BottomTitlePresenter"
|
||||
Content="{TemplateBinding Header}"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Margin="8,0,0,0"
|
||||
IsVisible="{TemplateBinding Header, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
</DockPanel>
|
||||
<Border Name="PART_Backdrop"
|
||||
Background="{TemplateBinding BackdropBrush}"
|
||||
IsVisible="False"
|
||||
IsHitTestVisible="False" />
|
||||
</Grid>
|
||||
</SplitView>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:placement-right /template/ ToggleButton#PART_PaneButton">
|
||||
<Setter Property="DockPanel.Dock" Value="Right" />
|
||||
</Style>
|
||||
|
||||
<!-- Bottom placement: swap top bar for bottom bar -->
|
||||
<Style Selector="^:placement-bottom /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:placement-bottom /template/ Border#PART_BottomBar">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- Bottom placement + compact modes: pane compact strip provides toggle, hide bottom bar -->
|
||||
<Style Selector="^:placement-bottom[DisplayMode=CompactOverlay] /template/ Border#PART_BottomBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^:placement-bottom[DisplayMode=CompactInline] /template/ Border#PART_BottomBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- Horizontal pane (Bottom/Top): compact toggle must dock Left so drawer content can fill the rest -->
|
||||
<Style Selector="^:placement-bottom /template/ ToggleButton#PART_CompactPaneToggle">
|
||||
<Setter Property="DockPanel.Dock" Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="^:placement-top /template/ ToggleButton#PART_CompactPaneToggle">
|
||||
<Setter Property="DockPanel.Dock" Value="Left" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DrawerBehavior=Locked] /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DrawerBehavior=Disabled] /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:detail-is-navpage /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DisplayMode=CompactOverlay] /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DisplayMode=CompactOverlay] /template/ ToggleButton#PART_CompactPaneToggle">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DisplayMode=CompactInline] /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[DisplayMode=CompactInline] /template/ ToggleButton#PART_CompactPaneToggle">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^[IsInNavigationPage=True] /template/ Border#PART_TopBar">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
<!-- NavigationPage already hosts a hamburger toggle — suppress the compact pane toggle. -->
|
||||
<Style Selector="^:detail-is-navpage /template/ ToggleButton#PART_CompactPaneToggle">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<Border Width="400" Height="600">
|
||||
<NavigationPage Header="Hello">
|
||||
<ContentPage>
|
||||
<TextBlock Text="Hi" />
|
||||
</ContentPage>
|
||||
</NavigationPage>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ui:FASymbolIconSource x:Key="NavigationPageBackIcon" Symbol="Back" FontSize="20" />
|
||||
|
||||
<SolidColorBrush x:Key="NavigationBarBackground" Color="{DynamicResource LayerFillColorDefault}" />
|
||||
<SolidColorBrush x:Key="NavigationBarForeground" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
|
||||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%"
|
||||
x:Key="NavBarShadowGradient">
|
||||
<GradientStop Color="#0C000000" Offset="0" />
|
||||
<GradientStop Color="#00000000" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage">
|
||||
<!-- Transparent keeps the hit-test surface active for the back-swipe gesture edge area. -->
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="PageTransition">
|
||||
<Setter.Value>
|
||||
<PageSlide Duration="0:0:0.3" Orientation="Horizontal" FillMode="Forward">
|
||||
<PageSlide.SlideInEasing>
|
||||
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" />
|
||||
</PageSlide.SlideInEasing>
|
||||
<PageSlide.SlideOutEasing>
|
||||
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" />
|
||||
</PageSlide.SlideOutEasing>
|
||||
</PageSlide>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ModalTransition">
|
||||
<Setter.Value>
|
||||
<PageSlide Duration="0:0:0.25" Orientation="Vertical" FillMode="Forward">
|
||||
<PageSlide.SlideInEasing>
|
||||
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" />
|
||||
</PageSlide.SlideInEasing>
|
||||
<PageSlide.SlideOutEasing>
|
||||
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" />
|
||||
</PageSlide.SlideOutEasing>
|
||||
</PageSlide>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<!-- ClipToBounds prevents slide animations bleeding outside the control bounds. -->
|
||||
<Panel ClipToBounds="True">
|
||||
<DockPanel>
|
||||
<!-- Reserves nav-bar height in Inset mode. Invisible in Overlay mode. -->
|
||||
<Border Name="PART_NavBarSpacer"
|
||||
Height="{TemplateBinding EffectiveBarHeight}"
|
||||
IsVisible="False"
|
||||
DockPanel.Dock="Top" />
|
||||
|
||||
<ContentPresenter Name="PART_BottomCommandBar"
|
||||
DockPanel.Dock="Bottom"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{Binding CurrentPage?.(NavigationPage.BottomCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" />
|
||||
|
||||
<!-- Back and front presenters enable slide transitions without Control recycling. -->
|
||||
<Grid Name="PART_ContentHost"
|
||||
Background="{TemplateBinding Background}"
|
||||
ClipToBounds="True">
|
||||
<ContentPresenter Name="PART_PageBackPresenter"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
<ContentPresenter Name="PART_PagePresenter"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
<!-- Navigation bar floats above content (ZIndex=1). -->
|
||||
<Border Name="PART_NavigationBar"
|
||||
ZIndex="1"
|
||||
VerticalAlignment="Top"
|
||||
ClipToBounds="True"
|
||||
Height="{TemplateBinding EffectiveBarHeight}">
|
||||
<Grid Margin="12,0,0,0" ColumnDefinitions="Auto, *, Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="Button#PART_BackButton /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_BackButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_BackButton:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_BackButton:disabled">
|
||||
<Setter Property="Opacity" Value="0.4" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_BackButton:focus-visible /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<!--<Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />-->
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
<Setter Property="CornerRadius" Value="4" />
|
||||
</Style>
|
||||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_OverflowButton /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_OverflowButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_OverflowButton:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
|
||||
<Button Name="PART_BackButton"
|
||||
Grid.Column="0"
|
||||
Background="Transparent"
|
||||
IsVisible="{TemplateBinding IsBackButtonEffectivelyVisible}"
|
||||
Foreground="{DynamicResource NavigationBarForeground}"
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
VerticalAlignment="Center"
|
||||
Padding="8"
|
||||
ToolTip.Tip="{x:Null}">
|
||||
<Panel Background="Transparent">
|
||||
<ui:FAIconSourceElement IconSource="{StaticResource NavigationPageBackIcon}"
|
||||
Name="PART_BackButtonDefaultIcon"
|
||||
Foreground="{DynamicResource NavigationBarForeground}"
|
||||
Width="24"
|
||||
Height="24"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
<ContentPresenter Name="PART_BackButtonContentPresenter"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"/>
|
||||
</Panel>
|
||||
</Button>
|
||||
|
||||
<ContentPresenter Name="PART_Header"
|
||||
Grid.Column="1"
|
||||
FontSize="20"
|
||||
Foreground="{DynamicResource NavigationBarForeground}"
|
||||
Content="{Binding CurrentPage?.Header, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
||||
ContentTemplate="{Binding CurrentPage?.HeaderTemplate, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Margin="0,0,12,0" />
|
||||
|
||||
<ContentPresenter Name="PART_TopCommandBar"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Foreground="{DynamicResource NavigationBarForeground}"
|
||||
Content="{Binding CurrentPage?.(NavigationPage.TopCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}">
|
||||
<ContentPresenter.Styles>
|
||||
<Style Selector="CommandBar">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="CommandBarButton">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="8,0" />
|
||||
</Style>
|
||||
<Style Selector="CommandBarToggleButton">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="8,0" />
|
||||
</Style>
|
||||
<Style Selector="Button#PART_OverflowButton">
|
||||
<Setter Property="MinHeight" Value="0" />
|
||||
<Setter Property="Padding" Value="8,0" />
|
||||
</Style>
|
||||
</ContentPresenter.Styles>
|
||||
</ContentPresenter>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Nav-bar shadow gradient. Margin.Top is set from code to match EffectiveBarHeight. -->
|
||||
<Border Name="PART_NavBarShadow"
|
||||
ZIndex="1"
|
||||
VerticalAlignment="Top"
|
||||
IsVisible="False"
|
||||
Height="4"
|
||||
IsHitTestVisible="False"
|
||||
Background="{StaticResource NavBarShadowGradient}" />
|
||||
|
||||
<!-- Modal overlay: ZIndex=99 holds the static layer during transitions; ZIndex=100 is the animating modal. -->
|
||||
<ContentPresenter Name="PART_ModalBackPresenter"
|
||||
ZIndex="99"
|
||||
IsVisible="False"
|
||||
Background="{TemplateBinding Background}" />
|
||||
<ContentPresenter Name="PART_ModalPresenter"
|
||||
ZIndex="100"
|
||||
IsVisible="False"
|
||||
Background="{TemplateBinding Background}" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Default nav bar background, overridable via a more-specific style selector -->
|
||||
<Style Selector="^ /template/ Border#PART_NavigationBar">
|
||||
<Setter Property="Background" Value="{DynamicResource NavigationBarBackground}" />
|
||||
</Style>
|
||||
|
||||
<!-- :nav-bar-inset: spacer reserves nav-bar height so content is pushed below -->
|
||||
<Style Selector="^:nav-bar-inset /template/ Border#PART_NavBarSpacer">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- :nav-bar-compact: collapse CommandBar labels when bar is too short -->
|
||||
<Style Selector="^:nav-bar-compact /template/ ContentPresenter#PART_TopCommandBar CommandBar">
|
||||
<Setter Property="DefaultLabelPosition" Value="Collapsed" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,277 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sty="using:FluentAvalonia.Styling">
|
||||
|
||||
<Design.PreviewWith>
|
||||
<Border Width="400" Height="400">
|
||||
<TabbedPage>
|
||||
<ContentPage Header="Home">
|
||||
<TextBlock Text="Home page" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
<ContentPage Header="Favorites">
|
||||
<TextBlock Text="Favorites page" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
<ContentPage Header="Profile">
|
||||
<TextBlock Text="Profile page" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</ContentPage>
|
||||
</TabbedPage>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<!-- Backgrounds -->
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundUnselected" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundUnselectedPointerOver" ResourceKey="SubtleFillColorSecondaryBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundSelectedPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundUnselectedPressed" ResourceKey="SubtleFillColorTertiaryBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundSelectedPressed" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderBackgroundDisabled" ResourceKey="SubtleFillColorDisabledBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemSelectionIndicatorBackground" ResourceKey="AccentFillColorDefaultBrush" />
|
||||
|
||||
<!-- Foregrounds (override via TabbedPageTabItemHeaderForegroundSelected / TabbedPageTabItemHeaderForegroundUnselected resources) -->
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderForegroundUnselected" ResourceKey="TextFillColorSecondaryBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderForegroundSelected" ResourceKey="TextFillColorPrimaryBrush" />
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderForegroundDisabled" ResourceKey="TextFillColorDisabledBrush" />
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderPipeThickness">2</x:Double>
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderVerticalPipeHeight">18</x:Double>
|
||||
|
||||
<CornerRadius x:Key="TabbedPageTabItemHeaderIndicatorCornerRadius">4</CornerRadius>
|
||||
<Thickness x:Key="TabbedPageTabItemHeaderIndicatorMargin">2 0</Thickness>
|
||||
|
||||
<!-- Tab item sizing & shape -->
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderMinHeight">48</x:Double>
|
||||
<StaticResource x:Key="TabbedPageTabItemHeaderCornerRadius" ResourceKey="ControlCornerRadius" />
|
||||
<Thickness x:Key="TabbedPageTabItemHeaderPadding">8,4</Thickness>
|
||||
<Thickness x:Key="TabbedPageTabItemHeaderMargin">0</Thickness>
|
||||
|
||||
<!-- Icon + text header layout -->
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderIconSize">20</x:Double>
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderFontSize">14</x:Double>
|
||||
<x:Double x:Key="TabbedPageTabItemHeaderSpacing">4</x:Double>
|
||||
|
||||
<!-- Tab strip (bar) styling -->
|
||||
<StaticResource x:Key="TabbedPageTabStripBackground" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<CornerRadius x:Key="TabbedPageTabStripCornerRadius">0</CornerRadius>
|
||||
<Thickness x:Key="TabbedPageTabStripBorderThickness">0</Thickness>
|
||||
<StaticResource x:Key="TabbedPageTabStripBorderBrush" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
<Thickness x:Key="TabbedPageTabStripMargin">0</Thickness>
|
||||
<Thickness x:Key="TabbedPageTabStripPadding">0</Thickness>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="{x:Static sty:FluentAvaloniaTheme.HighContrastTheme}">
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
|
||||
<!-- TabbedPage TabControl theme -->
|
||||
<ControlTheme x:Key="TabbedPageTabControlTheme" TargetType="TabControl">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabStripBackground}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource TabbedPageTabStripCornerRadius}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TabbedPageTabStripBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource TabbedPageTabStripBorderThickness}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TabbedPageTabStripPadding}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DockPanel>
|
||||
<Border Name="PART_TabStrip"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Margin="{DynamicResource TabbedPageTabStripMargin}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
DockPanel.Dock="{TemplateBinding TabStripPlacement}">
|
||||
<ItemsPresenter Name="PART_ItemsPresenter">
|
||||
<ItemsPresenter.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Rows="1" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsPresenter.ItemsPanel>
|
||||
</ItemsPresenter>
|
||||
</Border>
|
||||
<Panel ClipToBounds="True">
|
||||
<ContentPresenter Name="PART_SelectedContentHost2"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsVisible="False" />
|
||||
<ContentPresenter Name="PART_SelectedContentHost"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch" />
|
||||
</Panel>
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > UniformGrid,
|
||||
^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > UniformGrid">
|
||||
<Setter Property="Rows" Value="0" />
|
||||
<Setter Property="Columns" Value="1" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- TabbedPage TabItem theme -->
|
||||
<ControlTheme x:Key="TabbedPageTabItemTheme" TargetType="TabItem">
|
||||
<Setter Property="FontSize" Value="{DynamicResource TabItemHeaderFontSize}" />
|
||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemHeaderThemeFontWeight}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselected}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundUnselected}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TabbedPageTabItemHeaderPadding}" />
|
||||
<Setter Property="Margin" Value="{DynamicResource TabbedPageTabItemHeaderMargin}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TabbedPageTabItemHeaderMinHeight}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource TabbedPageTabItemHeaderCornerRadius}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="IndicatorTemplate">
|
||||
<DataTemplate>
|
||||
<Border Background="{DynamicResource TabbedPageTabItemSelectionIndicatorBackground}"
|
||||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}"
|
||||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel>
|
||||
<Border Name="PART_LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel Name="PART_HeaderPanel"
|
||||
Spacing="{DynamicResource TabbedPageTabItemHeaderSpacing}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
<ContentPresenter Name="PART_IconPresenter"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}"
|
||||
HorizontalAlignment="Center"
|
||||
IsVisible="{TemplateBinding Icon, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Width="{DynamicResource TabbedPageTabItemHeaderIconSize}"
|
||||
Height="{DynamicResource TabbedPageTabItemHeaderIconSize}" />
|
||||
<ContentPresenter Name="PART_ContentPresenter"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="{DynamicResource TabbedPageTabItemHeaderFontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<ContentPresenter Name="PART_SelectedPipe"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
Content="{TemplateBinding DataContext}"
|
||||
ContentTemplate="{TemplateBinding IndicatorTemplate}"
|
||||
IsVisible="False" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Selected state -->
|
||||
<Style Selector="^:selected">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelected}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundSelected}" />
|
||||
</Style>
|
||||
<Style Selector="^:selected /template/ ContentPresenter#PART_SelectedPipe">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- Placement-specific pipe positioning -->
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ ContentPresenter#PART_SelectedPipe">
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="Height" Value="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Bottom] /template/ ContentPresenter#PART_SelectedPipe">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="Height" Value="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right]">
|
||||
<Setter Property="IndicatorTemplate">
|
||||
<DataTemplate>
|
||||
<Border Background="{DynamicResource TabbedPageTabItemSelectionIndicatorBackground}"
|
||||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}"
|
||||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}"
|
||||
Width="{DynamicResource TabbedPageTabItemHeaderPipeThickness}"
|
||||
Height="{DynamicResource TabbedPageTabItemHeaderVerticalPipeHeight}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ContentPresenter#PART_SelectedPipe">
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left]">
|
||||
<Setter Property="IndicatorTemplate">
|
||||
<DataTemplate>
|
||||
<Border Background="{DynamicResource TabbedPageTabItemSelectionIndicatorBackground}"
|
||||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}"
|
||||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}"
|
||||
Width="{DynamicResource TabbedPageTabItemHeaderPipeThickness}"
|
||||
Height="{DynamicResource TabbedPageTabItemHeaderVerticalPipeHeight}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ContentPresenter#PART_SelectedPipe">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<!-- Pointer-over -->
|
||||
<Style Selector="^:pointerover /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselectedPointerOver}" />
|
||||
</Style>
|
||||
|
||||
<!-- Selected + pointer-over -->
|
||||
<Style Selector="^:selected:pointerover /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelectedPointerOver}" />
|
||||
</Style>
|
||||
|
||||
<!-- Pressed -->
|
||||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselectedPressed}" />
|
||||
</Style>
|
||||
|
||||
<!-- Selected + pressed -->
|
||||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelectedPressed}" />
|
||||
</Style>
|
||||
|
||||
<!-- Disabled -->
|
||||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundDisabled}" />
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundDisabled}" />
|
||||
</Style>
|
||||
|
||||
<!-- Focus visible -->
|
||||
<Style Selector="^:focus-visible /template/ Border#PART_LayoutRoot">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type TabbedPage}" TargetType="TabbedPage">
|
||||
<Setter Property="Background" Value="{DynamicResource SystemControlPageBackgroundAltHighBrush}" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Panel Background="{TemplateBinding Background}">
|
||||
<TabControl Name="PART_TabControl"
|
||||
Theme="{StaticResource TabbedPageTabControlTheme}"
|
||||
ItemContainerTheme="{StaticResource TabbedPageTabItemTheme}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -60,7 +60,12 @@
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/HyperlinkButtonStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/FocusAdornerStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/PipsPagerStyles.axaml" />
|
||||
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/GroupBoxStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/Page/ContentPageStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/Page/CarouselPageStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/Page/DrawerPageStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/Page/NavigationPageStyles.axaml" />
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/BasicControls/Page/TabbedPageStyles.axaml" />
|
||||
|
||||
<!-- FluentAvalonia Controls -->
|
||||
<MergeResourceInclude Source="/Styling/ControlThemes/FAControls/FrameStyles.axaml" />
|
||||
|
||||
Reference in New Issue
Block a user