zoukankan      html  css  js  c++  java
  • uwp 动画之圆的放大与缩小

    xml code

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

    <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}">

        

        <Grid>

            <Grid.Resources>

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

                    <DoubleAnimation Storyboard.TargetName="scltrf" Storyboard.TargetProperty="ScaleX" Duration="0:0:2" From="1" To="2"/>

                    <DoubleAnimation Storyboard.TargetName="scltrf" Storyboard.TargetProperty="ScaleY" Duration="0:0:2" From="1" To="2"/>

                </Storyboard>

            </Grid.Resources>

            <Ellipse Width="150" Height="150" Fill="SkyBlue" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">

                <Ellipse.RenderTransform>

                    <ScaleTransform x:Name="scltrf"/>

                </Ellipse.RenderTransform>

            </Ellipse>

        </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)

            {

                this.std.Begin();

            }

        }

  • 相关阅读:
    电脑无法删除文件提示源路径太长怎么办|电脑由于文件名太长无法删除的解决方法
    史上最清晰的红黑树讲解(上)
    深入理解Java PriorityQueue
    为什么你的博客不够火?
    Java ArrayDeque源码剖析
    Java LinkedList源码剖析
    Java HashSet和HashMap源码剖析
    Java ArrayList源码剖析
    Java Collections Framework概览
    顺序对齐
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14222500.html
Copyright © 2011-2022 走看看