zoukankan      html  css  js  c++  java
  • UWP 动画之路径

    xml

    ---------------------------------------------

    <Page

        x:Class="MyApp.MainPage"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:local="using:MyApp"

        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

        mc:Ignorable="d"

        Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <Page.Resources>

            <Storyboard x:Key="std" x:Name="std" RepeatBehavior="Forever">

                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ttf" Storyboard.TargetProperty="Y" Duration="0:0:10">

                    <LinearDoubleKeyFrame KeyTime="0:0:2" Value="200"/>

                    <EasingDoubleKeyFrame KeyTime="0:0:6" Value="-300">

                        <EasingDoubleKeyFrame.EasingFunction>

                            <QuinticEase/>

                        </EasingDoubleKeyFrame.EasingFunction>

                    </EasingDoubleKeyFrame>

                    <LinearDoubleKeyFrame KeyTime="0:0:10" Value="0"/>

                </DoubleAnimationUsingKeyFrames>

            </Storyboard>

        </Page.Resources>

        

        <Grid>

            <Rectangle Width="100" Height="100" Fill="Khaki">

                <Rectangle.RenderTransform>

                    <TranslateTransform x:Name="ttf"/>

                </Rectangle.RenderTransform>

            </Rectangle>

        </Grid>

    </Page>

    C#   code

    ----------------------------------------------

     public sealed partial class MainPage : Page

        {

            public MainPage()

            {

                this.InitializeComponent();

                this.NavigationCacheMode = NavigationCacheMode.Required;

            }

            /// <summary>

            /// 在此页将要在 Frame 中显示时进行调用。

            /// </summary>

            /// <param name="e">描述如何访问此页的事件数据。

            /// 此参数通常用于配置页。</param>

            protected override void OnNavigatedTo(NavigationEventArgs e)

            {

                std.Begin();

            }

        }

  • 相关阅读:
    [iOS]UIDynamicAnimator动画
    [iOS]被忽略的main函数
    [iOS]app的生命周期
    vue 封装http请求时错误信息提示使用element-ui message,只提示一次
    angular8 Vue 导出excel文件
    python3 tornado api + angular8 + nginx 跨域问题
    ubutu tornado python3.7.5 nginx supervisor 部署web api
    angular cli 反向代理实现跨域
    angular8自定义管道、指令以及获取dom值
    angular cli 使用echarts
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14222677.html
Copyright © 2011-2022 走看看