|
| 1 | +<!-- Copyright (c) Files Community. Licensed under the MIT License. --> |
| 2 | +<MenuFlyoutItem |
| 3 | + x:Class="Files.App.UserControls.MenuFlyoutHeaderItem" |
| 4 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 6 | + xmlns:controls="using:Files.App.Controls" |
| 7 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 8 | + xmlns:local="using:Files.App.UserControls" |
| 9 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 10 | + d:DesignHeight="300" |
| 11 | + d:DesignWidth="400" |
| 12 | + HighContrastAdjustment="None" |
| 13 | + mc:Ignorable="d"> |
| 14 | + |
| 15 | + <MenuFlyoutItem.Style> |
| 16 | + <Style TargetType="local:MenuFlyoutHeaderItem"> |
| 17 | + <Setter Property="Padding" Value="{ThemeResource MenuFlyoutItemThemePadding}" /> |
| 18 | + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> |
| 19 | + <Setter Property="IsEnabled" Value="False" /> |
| 20 | + <Setter Property="Template"> |
| 21 | + <Setter.Value> |
| 22 | + <ControlTemplate TargetType="local:MenuFlyoutHeaderItem"> |
| 23 | + |
| 24 | + <Grid |
| 25 | + x:Name="LayoutRoot" |
| 26 | + Margin="{StaticResource MenuFlyoutItemMargin}" |
| 27 | + Padding="{TemplateBinding Padding}" |
| 28 | + Background="{TemplateBinding Background}" |
| 29 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 30 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 31 | + CornerRadius="{StaticResource ControlCornerRadius}"> |
| 32 | + <TextBlock |
| 33 | + x:Name="TextBlock" |
| 34 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 35 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 36 | + FontWeight="SemiBold" |
| 37 | + Foreground="{ThemeResource TextFillColorTertiaryBrush}" |
| 38 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 39 | + Text="{TemplateBinding Text}" |
| 40 | + TextTrimming="Clip" /> |
| 41 | + |
| 42 | + <VisualStateManager.VisualStateGroups> |
| 43 | + <VisualStateGroup x:Name="CommonStates"> |
| 44 | + <VisualState x:Name="Normal" /> |
| 45 | + <VisualState x:Name="PointerOver" /> |
| 46 | + <VisualState x:Name="Pressed" /> |
| 47 | + <VisualState x:Name="Disabled" /> |
| 48 | + </VisualStateGroup> |
| 49 | + <VisualStateGroup x:Name="CheckPlaceholderStates"> |
| 50 | + <VisualState x:Name="NoPlaceholder" /> |
| 51 | + <VisualState x:Name="CheckPlaceholder" /> |
| 52 | + <VisualState x:Name="IconPlaceholder" /> |
| 53 | + <VisualState x:Name="CheckAndIconPlaceholder" /> |
| 54 | + </VisualStateGroup> |
| 55 | + <!-- Narrow padding is only applied when flyout was invoked with pen, mouse or keyboard. --> |
| 56 | + <!-- Default padding is applied for all other cases including touch. --> |
| 57 | + <VisualStateGroup x:Name="PaddingSizeStates"> |
| 58 | + <VisualState x:Name="DefaultPadding" /> |
| 59 | + <VisualState x:Name="NarrowPadding"> |
| 60 | + <Storyboard> |
| 61 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Padding"> |
| 62 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource MenuFlyoutItemThemePaddingNarrow}" /> |
| 63 | + </ObjectAnimationUsingKeyFrames> |
| 64 | + </Storyboard> |
| 65 | + </VisualState> |
| 66 | + </VisualStateGroup> |
| 67 | + <VisualStateGroup x:Name="KeyboardAcceleratorTextVisibility"> |
| 68 | + <VisualState x:Name="KeyboardAcceleratorTextCollapsed" /> |
| 69 | + <VisualState x:Name="KeyboardAcceleratorTextVisible" /> |
| 70 | + </VisualStateGroup> |
| 71 | + </VisualStateManager.VisualStateGroups> |
| 72 | + </Grid> |
| 73 | + </ControlTemplate> |
| 74 | + </Setter.Value> |
| 75 | + </Setter> |
| 76 | + </Style> |
| 77 | + </MenuFlyoutItem.Style> |
| 78 | +</MenuFlyoutItem> |
0 commit comments