This commit is contained in:
NaBian committed 2019-11-02 10:23:27 +08:00
1 parent 638b5311bf
commit fdadb2c2cb
2 files changed
+6 -13

No files matched your search

@@ -12,8 +12,6 @@ namespace HandyControl.Controls
{
public class AnimationPath : Shape
{
private bool _isLoaded;
/// <summary>
/// 故事板
/// </summary>
@@ -126,15 +124,7 @@ namespace HandyControl.Controls
OnPropertiesChanged));
}
public AnimationPath()
{
Loaded += (s, e) =>
{
if (_isLoaded) return;
UpdatePath();
_isLoaded = true;
};
}
public AnimationPath() => Loaded += (s, e) => UpdatePath();
/// <summary>
/// 动画完成事件
@@ -142,8 +142,11 @@
<TextBlock Margin="0,10,0,0" Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Text}"/>
</StackPanel>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource StoryboardOnLoaded}"/>
<EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="PART_Wave">
<BeginStoryboard Name="BeginStoryboardWave" Storyboard="{StaticResource StoryboardOnLoaded}"/>
</EventTrigger>
<EventTrigger RoutedEvent="FrameworkElement.Unloaded" SourceName="PART_Wave">
<StopStoryboard BeginStoryboardName="BeginStoryboardWave"/>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>