码迷,mamicode.com
首页 > 其他好文 > 详细

uwp 动画之圆的放大与缩小

时间:2021-01-05 11:33:51      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:数通   void   bsp   override   horizon   protected   event   expr   ati   

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();

        }

    }

 

uwp 动画之圆的放大与缩小

标签:数通   void   bsp   override   horizon   protected   event   expr   ati   

原文地址:https://www.cnblogs.com/bruce1992/p/14222500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!