|
| 1 | +<!-- Copyright (c) Files Community. Licensed under the MIT License. --> |
| 2 | +<ResourceDictionary |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:local="using:Files.App.Controls"> |
| 6 | + |
| 7 | + <Style BasedOn="{StaticResource DefaultBreadcrumbBarStyle}" TargetType="local:BreadcrumbBar" /> |
| 8 | + <Style BasedOn="{StaticResource DefaultBreadcrumbBarItemStyle}" TargetType="local:BreadcrumbBarItem" /> |
| 9 | + |
| 10 | + <Style x:Key="DefaultBreadcrumbBarStyle" TargetType="local:BreadcrumbBar"> |
| 11 | + <Setter Property="AutomationProperties.LandmarkType" Value="Navigation" /> |
| 12 | + <Setter Property="IsTabStop" Value="False" /> |
| 13 | + <Setter Property="Template"> |
| 14 | + <Setter.Value> |
| 15 | + <ControlTemplate TargetType="local:BreadcrumbBar"> |
| 16 | + <ItemsRepeater x:Name="PART_RootItemsRepeater"> |
| 17 | + <ItemsRepeater.Layout> |
| 18 | + <StackLayout Orientation="Horizontal" /> |
| 19 | + </ItemsRepeater.Layout> |
| 20 | + </ItemsRepeater> |
| 21 | + </ControlTemplate> |
| 22 | + </Setter.Value> |
| 23 | + </Setter> |
| 24 | + </Style> |
| 25 | + |
| 26 | + <Style x:Key="DefaultBreadcrumbBarItemStyle" TargetType="local:BreadcrumbBarItem"> |
| 27 | + <Setter Property="Background" Value="{ThemeResource BreadcrumbBarBackgroundBrush}" /> |
| 28 | + <Setter Property="BorderBrush" Value="{ThemeResource BreadcrumbBarBorderBrush}" /> |
| 29 | + <Setter Property="FocusVisualMargin" Value="1" /> |
| 30 | + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> |
| 31 | + <Setter Property="FontSize" Value="{ThemeResource BreadcrumbBarItemThemeFontSize}" /> |
| 32 | + <Setter Property="FontWeight" Value="{ThemeResource BreadcrumbBarItemFontWeight}" /> |
| 33 | + <Setter Property="Foreground" Value="{ThemeResource BreadcrumbBarForegroundBrush}" /> |
| 34 | + <Setter Property="HorizontalAlignment" Value="Stretch" /> |
| 35 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| 36 | + <Setter Property="IsTabStop" Value="True" /> |
| 37 | + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> |
| 38 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 39 | + <Setter Property="VerticalContentAlignment" Value="Center" /> |
| 40 | + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> |
| 41 | + <Setter Property="Template"> |
| 42 | + <Setter.Value> |
| 43 | + <ControlTemplate TargetType="local:BreadcrumbBarItem"> |
| 44 | + <Grid x:Name="PART_LayoutRoot" CornerRadius="{TemplateBinding CornerRadius}"> |
| 45 | + <Grid.ColumnDefinitions> |
| 46 | + <ColumnDefinition x:Name="PART_ContentColumn" Width="Auto" /> |
| 47 | + <ColumnDefinition x:Name="PART_ChevronColumn" Width="Auto" /> |
| 48 | + </Grid.ColumnDefinitions> |
| 49 | + |
| 50 | + <!-- Clickable Area --> |
| 51 | + <Button |
| 52 | + x:Name="PART_ItemButton" |
| 53 | + AutomationProperties.AccessibilityView="Raw" |
| 54 | + Background="{TemplateBinding Background}" |
| 55 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 56 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 57 | + Control.IsTemplateFocusTarget="True" |
| 58 | + CornerRadius="{TemplateBinding CornerRadius}" |
| 59 | + FocusVisualMargin="-3" |
| 60 | + IsTabStop="False"> |
| 61 | + <Grid AutomationProperties.AccessibilityView="Raw"> |
| 62 | + <ContentPresenter |
| 63 | + x:Name="PART_ItemContentPresenter" |
| 64 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 65 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 66 | + AutomationProperties.AccessibilityView="Raw" |
| 67 | + Content="{TemplateBinding Content}" |
| 68 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 69 | + ContentTransitions="{TemplateBinding ContentTransitions}" |
| 70 | + FontFamily="{TemplateBinding FontFamily}" |
| 71 | + FontSize="{TemplateBinding FontSize}" |
| 72 | + FontWeight="{TemplateBinding FontWeight}" /> |
| 73 | + <TextBlock |
| 74 | + x:Name="PART_EllipsisTextBlock" |
| 75 | + Padding="3" |
| 76 | + VerticalAlignment="Stretch" |
| 77 | + AutomationProperties.AccessibilityView="Raw" |
| 78 | + FontFamily="{ThemeResource SymbolThemeFontFamily}" |
| 79 | + FontSize="{TemplateBinding FontSize}" |
| 80 | + IsTextScaleFactorEnabled="False" |
| 81 | + Text="" |
| 82 | + Visibility="Collapsed" /> |
| 83 | + </Grid> |
| 84 | + </Button> |
| 85 | + |
| 86 | + <!-- Chevron --> |
| 87 | + <TextBlock |
| 88 | + x:Name="PART_ChevronTextBlock" |
| 89 | + Grid.Column="1" |
| 90 | + Padding="{ThemeResource BreadcrumbBarChevronPadding}" |
| 91 | + HorizontalAlignment="Center" |
| 92 | + VerticalAlignment="Center" |
| 93 | + AutomationProperties.AccessibilityView="Raw" |
| 94 | + FontFamily="{ThemeResource SymbolThemeFontFamily}" |
| 95 | + FontSize="{ThemeResource BreadcrumbBarChevronFontSize}" |
| 96 | + Foreground="{ThemeResource BreadcrumbBarNormalForegroundBrush}" |
| 97 | + IsTextScaleFactorEnabled="False" |
| 98 | + Text="" /> |
| 99 | + |
| 100 | + <VisualStateManager.VisualStateGroups> |
| 101 | + <VisualStateGroup x:Name="ItemTypeStates"> |
| 102 | + <VisualState x:Name="DefaultItemType" /> |
| 103 | + <VisualState x:Name="LastItemType"> |
| 104 | + <VisualState.Setters> |
| 105 | + <Setter Target="PART_ItemButton.Visibility" Value="Collapsed" /> |
| 106 | + </VisualState.Setters> |
| 107 | + </VisualState> |
| 108 | + <!--<VisualState x:Name="CollapsedItemType"> |
| 109 | + <VisualState.Setters> |
| 110 | + </VisualState.Setters> |
| 111 | + </VisualState>--> |
| 112 | + </VisualStateGroup> |
| 113 | + </VisualStateManager.VisualStateGroups> |
| 114 | + </Grid> |
| 115 | + </ControlTemplate> |
| 116 | + </Setter.Value> |
| 117 | + </Setter> |
| 118 | + </Style> |
| 119 | + |
| 120 | + <Style x:Key="DefaultBreadcrumbEllipsisFlyoutStyle" TargetType="FlyoutPresenter"> |
| 121 | + <Setter Property="Background" Value="{ThemeResource BreadcrumbBarEllipsisFlyoutPresenterBackground}" /> |
| 122 | + <Setter Property="BorderBrush" Value="{ThemeResource BreadcrumbBarEllipsisFlyoutPresenterBorderBrush}" /> |
| 123 | + <Setter Property="BorderThickness" Value="{ThemeResource BreadcrumbBarEllipsisFlyoutPresenterBorderThemeThickness}" /> |
| 124 | + <Setter Property="Padding" Value="0,2" /> |
| 125 | + <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" /> |
| 126 | + <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" /> |
| 127 | + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
| 128 | + <Setter Property="ScrollViewer.IsHorizontalRailEnabled" Value="False" /> |
| 129 | + <Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="False" /> |
| 130 | + <Setter Property="ScrollViewer.ZoomMode" Value="Disabled" /> |
| 131 | + <Setter Property="MaxWidth" Value="{ThemeResource FlyoutThemeMaxWidth}" /> |
| 132 | + <Setter Property="MinHeight" Value="40" /> |
| 133 | + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> |
| 134 | + <Setter Property="Template"> |
| 135 | + <Setter.Value> |
| 136 | + <ControlTemplate TargetType="FlyoutPresenter"> |
| 137 | + <Grid |
| 138 | + Background="{TemplateBinding Background}" |
| 139 | + BackgroundSizing="InnerBorderEdge" |
| 140 | + CornerRadius="{TemplateBinding CornerRadius}"> |
| 141 | + <ScrollViewer |
| 142 | + x:Name="FlyoutPresenterScrollViewer" |
| 143 | + Margin="{TemplateBinding Padding}" |
| 144 | + AutomationProperties.AccessibilityView="Raw" |
| 145 | + Content="{TemplateBinding Content}" |
| 146 | + HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
| 147 | + HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" |
| 148 | + IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" |
| 149 | + IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" |
| 150 | + VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" |
| 151 | + VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" |
| 152 | + ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}" /> |
| 153 | + <Border |
| 154 | + x:Name="FlyoutPresenterBorder" |
| 155 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 156 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 157 | + CornerRadius="{TemplateBinding CornerRadius}" /> |
| 158 | + </Grid> |
| 159 | + </ControlTemplate> |
| 160 | + </Setter.Value> |
| 161 | + </Setter> |
| 162 | + </Style> |
| 163 | + |
| 164 | +</ResourceDictionary> |
0 commit comments