Skip to content

Commit

Permalink
Merge commit '2f04fe5286870d6d63957f548df178f795755524'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Jun 26, 2024
2 parents 0909f27 + 2f04fe5 commit fcca5c2
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions UnoDemo/ButtonDemo/ButtonDemo/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" Background="{TemplateBinding Background}" BackgroundSizing="{TemplateBinding BackgroundSizing}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ContentTemplate="{TemplateBinding ContentTemplate}" CornerRadius="{TemplateBinding CornerRadius}" Content="{TemplateBinding Content}" ContentTransitions="{TemplateBinding ContentTransitions}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">

<Path x:Name="ButtonContentPath" StrokeThickness="2" Stroke="#FF666666" Data="M7,15C6.85289858,15.5677816,6.85289858,16.4322348,7,17L22,29C22.7348015,29.3762198,24,28.8227297,24,28L24,4C24,3.1772867,22.7348015,2.62379657,22,3L7,15z"></Path>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="PointerOver">
<!-- Hover 效果 -->
<Storyboard>
<DoubleAnimation Duration="0:0:1.2" To="10" Storyboard.TargetName="ButtonContentPath" Storyboard.TargetProperty="StrokeThickness"></DoubleAnimation>
<!--<ObjectAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="ButtonContentPath" Storyboard.TargetProperty="StrokeThickness">
<ObjectAnimationUsingKeyFrames.KeyFrames>
<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="0.0" ></DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames.KeyFrames>
</ObjectAnimationUsingKeyFrames>-->
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand All @@ -21,23 +39,7 @@
<Border BorderBrush="Black" BorderThickness="0">
<Button Style="{StaticResource Style.Button.EmptyButtonStyle}"
Background="Transparent" Padding="0">
<Path x:Name="ButtonContentPath" StrokeThickness="2" Stroke="#FF666666" Data="M7,15C6.85289858,15.5677816,6.85289858,16.4322348,7,17L22,29C22.7348015,29.3762198,24,28.8227297,24,28L24,4C24,3.1772867,22.7348015,2.62379657,22,3L7,15z"></Path>

<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="PointerOver">
<!-- Hover 效果 -->
<Storyboard>
<DoubleAnimation Duration="0:0:1.2" To="10" Storyboard.TargetName="ButtonContentPath" Storyboard.TargetProperty="StrokeThickness"></DoubleAnimation>
<!--<ObjectAnimationUsingKeyFrames EnableDependentAnimation="True" Storyboard.TargetName="ButtonContentPath" Storyboard.TargetProperty="StrokeThickness">
<ObjectAnimationUsingKeyFrames.KeyFrames>
<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="0.0" ></DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames.KeyFrames>
</ObjectAnimationUsingKeyFrames>-->
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Button>
</Border>
</StackPanel>
Expand Down

0 comments on commit fcca5c2

Please sign in to comment.