[MainPage.xaml]


<UserControl x:Class="RiaTimeline.MainPage"

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

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

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

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

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">

        <!-- 스토리보드 -->

        <Grid.Resources>

            <!-- 오른쪽으로 100픽셀 이동 -->

            <Storyboard x:Name="point">

                <PointAnimation

                    Storyboard.TargetName="won" Storyboard.TargetProperty="Center"

                    From="50,50" To="150,50" Duration="0:0:2" AutoReverse="True"

                />

            </Storyboard>

            <!-- Red에서 Blue 변경 -->

            <Storyboard x:Name="color">

                <ColorAnimation

                    Storyboard.TargetName="myPath"

                    Storyboard.TargetProperty="(Fill).(SolidColorBrush.Color)"

                    From="Red" To="Blue" Duration="0:0:2" AutoReverse="True"

                />

            </Storyboard>

        </Grid.Resources>

        <-- 요소 -->

        <Path x:Name="myPath" Fill="Red" Stroke="Blue">

            <Path.Data>

                <EllipseGeometry x:Name="won" Center="50,50" RadiusX="50" RadiusY="50" />

            </Path.Data>

        </Path>

    </Grid>

</UserControl>

 

 








[MainPage.xaml.cs]

using System;

using System.Collections.Generic;

using System.Linq;

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Animation;

using System.Windows.Shapes;

 

namespace RiaTimeline

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

 

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

        }

 

        void MainPage_Loaded(object sender, RoutedEventArgs e)

        {

            this.point.Begin();

            this.color.Begin();

        }

    }

}

 

 

 

 



































Posted by holland14
: