add GeometryAnimation Demo

This commit is contained in:
NaBian committed 2019-09-28 00:32:24 +08:00
1 parent 0e74e5b34e
commit 09f116d4a6
12 files changed
+89 -3

No files matched your search

+6 -2
View File
@@ -63,6 +63,10 @@ Step 4:enjoy coding
## Latest examples
### GeometryAnimation
![GeometryAnimation](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GeometryAnimation.gif)
### SplitButton
![SplitButton](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/SplitButton.png)
@@ -85,12 +89,12 @@ Step 4:enjoy coding
![ImageBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/ImageBlock.png)
## History publication
### Magnifier
![Magnifier](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Magnifier.png)
## History publication
### Card
![Card](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Card.png)
@@ -124,6 +124,8 @@
public static readonly string HatchBrushGeneratorDemoCtl = nameof(HatchBrushGeneratorDemoCtl);
public static readonly string GeometryAnimationDemoCtl = nameof(GeometryAnimationDemoCtl);
/*-------------------- Styles --------------------*/
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
@@ -96,7 +96,8 @@ var styleList = new List<string>
};
var toolList = new List<string>
{
"HatchBrushGeneratorDemoCtl"
"HatchBrushGeneratorDemoCtl",
"GeometryAnimationDemoCtl"
};
var windowList = new List<string>
{
@@ -328,6 +328,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\TreeViewDemoCtl.xaml.cs">
<DependentUpon>TreeViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Tools\GeometryAnimationDemoCtl.xaml.cs">
<DependentUpon>GeometryAnimationDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Tools\HatchBrushGeneratorDemoCtl.xaml.cs">
<DependentUpon>HatchBrushGeneratorDemoCtl.xaml</DependentUpon>
</Compile>
@@ -821,6 +824,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Tools\GeometryAnimationDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Tools\HatchBrushGeneratorDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -843,6 +843,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 变形动画 的本地化字符串。
/// </summary>
public static string Morphing_Animation {
get {
return ResourceManager.GetString("Morphing Animation", resourceCulture);
}
}
/// <summary>
/// 查找类似 名称 的本地化字符串。
/// </summary>
@@ -672,4 +672,7 @@
<data name="HatchBrushGenerator" xml:space="preserve">
<value>HatchBrushGenerator</value>
</data>
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
</root>
@@ -672,4 +672,7 @@
<data name="HatchBrushGenerator" xml:space="preserve">
<value>HatchBrushGenerator</value>
</data>
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
</root>
@@ -672,4 +672,7 @@
<data name="HatchBrushGenerator" xml:space="preserve">
<value>HatchBrushGenerator</value>
</data>
<data name="Morphing Animation" xml:space="preserve">
<value>Morphing Animation</value>
</data>
</root>
@@ -672,4 +672,7 @@
<data name="HatchBrushGenerator" xml:space="preserve">
<value>阴影画笔生成器</value>
</data>
<data name="Morphing Animation" xml:space="preserve">
<value>变形动画</value>
</data>
</root>
@@ -503,6 +503,11 @@
<Image Source="../../Resources/Img/LeftMainContent/DataGenerator_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.GeometryAnimationDemoCtl}" Content="{x:Static langs:Lang.Morphing_Animation}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Animation_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
</ListBox>
</Grid>
</TabItem>
@@ -0,0 +1,36 @@
<UserControl x:Class="HandyControlDemo.UserControl.GeometryAnimationDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}"
Width="200">
<UserControl.Resources>
<Storyboard x:Key="StoryboardOnLoaded" RepeatBehavior="Forever" AutoReverse="True">
<hc:GeometryAnimationUsingKeyFrames Storyboard.TargetProperty="Data" Storyboard.TargetName="PathDemo">
<hc:DiscreteGeometryKeyFrame KeyTime="0:0:0.7" Value="{StaticResource FaceBookGeometry}"/>
<hc:EasingGeometryKeyFrame KeyTime="0:0:1.2" Value="{StaticResource TwitterGeometry}">
<hc:EasingGeometryKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseInOut"/>
</hc:EasingGeometryKeyFrame.EasingFunction>
</hc:EasingGeometryKeyFrame>
</hc:GeometryAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Fill.(SolidColorBrush.Color)" Storyboard.TargetName="PathDemo">
<DiscreteColorKeyFrame KeyTime="0:0:0.7" Value="#3b5998"/>
<EasingColorKeyFrame KeyTime="0:0:1.2" Value="#4099ff">
<EasingColorKeyFrame.EasingFunction>
<QuarticEase EasingMode="EaseInOut"/>
</EasingColorKeyFrame.EasingFunction>
</EasingColorKeyFrame>
<EasingColorKeyFrame KeyTime="0:0:1.9" Value="#4099ff"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource StoryboardOnLoaded}"/>
</EventTrigger>
</UserControl.Triggers>
<hc:TransitioningContentControl>
<Path Name="PathDemo" Width="100" Height="100" Data="{StaticResource FaceBookGeometry}" Fill="#3b5998"/>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class GeometryAnimationDemoCtl
{
public GeometryAnimationDemoCtl()
{
InitializeComponent();
}
}
}