|
| 1 | +<ResourceDictionary |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:local="using:Richasy.Bili.App.Controls" |
| 5 | + xmlns:muxc="using:Microsoft.UI.Xaml.Controls"> |
| 6 | + |
| 7 | + <Style BasedOn="{StaticResource DefaultTwoLineButtonStyle}" TargetType="local:TwoLineButton" /> |
| 8 | + |
| 9 | + <Style x:Key="DefaultTwoLineButtonStyle" TargetType="local:TwoLineButton"> |
| 10 | + <Setter Property="Background" Value="Transparent" /> |
| 11 | + <Setter Property="BackgroundSizing" Value="InnerBorderEdge" /> |
| 12 | + <Setter Property="Foreground" Value="{ThemeResource ButtonForeground}" /> |
| 13 | + <Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderBrush}" /> |
| 14 | + <Setter Property="BorderThickness" Value="0" /> |
| 15 | + <Setter Property="Padding" Value="{StaticResource ButtonPadding}" /> |
| 16 | + <Setter Property="HorizontalAlignment" Value="Stretch" /> |
| 17 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 18 | + <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> |
| 19 | + <Setter Property="FontWeight" Value="Normal" /> |
| 20 | + <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> |
| 21 | + <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> |
| 22 | + <Setter Property="FocusVisualMargin" Value="-3" /> |
| 23 | + <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> |
| 24 | + <Setter Property="Template"> |
| 25 | + <Setter.Value> |
| 26 | + <ControlTemplate TargetType="local:TwoLineButton"> |
| 27 | + <Grid |
| 28 | + x:Name="ContentPresenter" |
| 29 | + Padding="{TemplateBinding Padding}" |
| 30 | + muxc:AnimatedIcon.State="Normal" |
| 31 | + AutomationProperties.AccessibilityView="Raw" |
| 32 | + Background="{TemplateBinding Background}" |
| 33 | + BackgroundSizing="{TemplateBinding BackgroundSizing}" |
| 34 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 35 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 36 | + CornerRadius="{TemplateBinding CornerRadius}"> |
| 37 | + |
| 38 | + <Grid.BackgroundTransition> |
| 39 | + <BrushTransition Duration="0:0:0.083" /> |
| 40 | + </Grid.BackgroundTransition> |
| 41 | + |
| 42 | + <VisualStateManager.VisualStateGroups> |
| 43 | + <VisualStateGroup x:Name="CommonStates"> |
| 44 | + <VisualState x:Name="Normal" /> |
| 45 | + |
| 46 | + <VisualState x:Name="PointerOver"> |
| 47 | + <Storyboard> |
| 48 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> |
| 49 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBackgroundPointerOver}" /> |
| 50 | + </ObjectAnimationUsingKeyFrames> |
| 51 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> |
| 52 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBorderBrushPointerOver}" /> |
| 53 | + </ObjectAnimationUsingKeyFrames> |
| 54 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstLineBlock" Storyboard.TargetProperty="Foreground"> |
| 55 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundPointerOver}" /> |
| 56 | + </ObjectAnimationUsingKeyFrames> |
| 57 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SecondLineBlock" Storyboard.TargetProperty="Foreground"> |
| 58 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundPointerOver}" /> |
| 59 | + </ObjectAnimationUsingKeyFrames> |
| 60 | + </Storyboard> |
| 61 | + <VisualState.Setters> |
| 62 | + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="PointerOver" /> |
| 63 | + </VisualState.Setters> |
| 64 | + </VisualState> |
| 65 | + |
| 66 | + <VisualState x:Name="Pressed"> |
| 67 | + <Storyboard> |
| 68 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> |
| 69 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBackgroundPressed}" /> |
| 70 | + </ObjectAnimationUsingKeyFrames> |
| 71 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> |
| 72 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBorderBrushPressed}" /> |
| 73 | + </ObjectAnimationUsingKeyFrames> |
| 74 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstLineBlock" Storyboard.TargetProperty="Foreground"> |
| 75 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundPressed}" /> |
| 76 | + </ObjectAnimationUsingKeyFrames> |
| 77 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SecondLineBlock" Storyboard.TargetProperty="Foreground"> |
| 78 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundPressed}" /> |
| 79 | + </ObjectAnimationUsingKeyFrames> |
| 80 | + </Storyboard> |
| 81 | + <VisualState.Setters> |
| 82 | + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Pressed" /> |
| 83 | + </VisualState.Setters> |
| 84 | + </VisualState> |
| 85 | + |
| 86 | + <VisualState x:Name="Disabled"> |
| 87 | + <Storyboard> |
| 88 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Background"> |
| 89 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBackgroundDisabled}" /> |
| 90 | + </ObjectAnimationUsingKeyFrames> |
| 91 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="BorderBrush"> |
| 92 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonBorderBrushDisabled}" /> |
| 93 | + </ObjectAnimationUsingKeyFrames> |
| 94 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstLineBlock" Storyboard.TargetProperty="Foreground"> |
| 95 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundDisabled}" /> |
| 96 | + </ObjectAnimationUsingKeyFrames> |
| 97 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SecondLineBlock" Storyboard.TargetProperty="Foreground"> |
| 98 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundDisabled}" /> |
| 99 | + </ObjectAnimationUsingKeyFrames> |
| 100 | + </Storyboard> |
| 101 | + <VisualState.Setters> |
| 102 | + <!-- DisabledVisual Should be handled by the control, not the animated icon. --> |
| 103 | + <Setter Target="ContentPresenter.(muxc:AnimatedIcon.State)" Value="Normal" /> |
| 104 | + </VisualState.Setters> |
| 105 | + </VisualState> |
| 106 | + </VisualStateGroup> |
| 107 | + </VisualStateManager.VisualStateGroups> |
| 108 | + |
| 109 | + <StackPanel Spacing="2"> |
| 110 | + <TextBlock |
| 111 | + x:Name="FirstLineBlock" |
| 112 | + Style="{StaticResource BodyTextBlockStyle}" |
| 113 | + HorizontalAlignment="Center" |
| 114 | + Text="{TemplateBinding FirstLineText}" /> |
| 115 | + <TextBlock |
| 116 | + x:Name="SecondLineBlock" |
| 117 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 118 | + HorizontalAlignment="Center" |
| 119 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 120 | + Text="{TemplateBinding SecondLineText}" /> |
| 121 | + </StackPanel> |
| 122 | + </Grid> |
| 123 | + </ControlTemplate> |
| 124 | + </Setter.Value> |
| 125 | + </Setter> |
| 126 | + </Style> |
| 127 | +</ResourceDictionary> |
0 commit comments