Views/AnimationView.xaml

(开头部分) 14KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<UserControl x:Class="MahAppsMetro.Demo.Views.AnimationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MahAppsMetro.Demo.Views"
             xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
    <UserControl.Resources>
        <PathGeometry x:Key="path1">
            <PathFigure IsClosed="True" StartPoint="50,50">
                <ArcSegment Point="100,200" Size="15,10" SweepDirection="Clockwise" />
                <ArcSegment Point="400,200" Size="15,10" />
            </PathFigure>
        </PathGeometry>
        <PathGeometry x:Key="path2">
            <PathFigure StartPoint="100,0">
                <LineSegment Point="100,400" />
            </PathFigure>
        </PathGeometry>
        <Storyboard x:Key="story1">
            <DoubleAnimationUsingPath Storyboard.TargetName="img1" Storyboard.TargetProperty="(Canvas.Left)" PathGeometry="{StaticResource path1}" Duration="0:0:5" RepeatBehavior="Forever" Source="X" />
            <DoubleAnimationUsingPath Storyboard.TargetName="img1" Storyboard.TargetProperty="(Canvas.Top)" PathGeometry="{StaticResource path1}" Duration="0:0:5" RepeatBehavior="Forever" Source="Y" />
        </Storyboard>
        <Storyboard x:Key="story2">
            <DoubleAnimationUsingPath Storyboard.TargetName="img1" Storyboard.TargetProperty="(Canvas.Top)" PathGeometry="{StaticResource path2}" Duration="0:0:5" RepeatBehavior="Forever" Source="Y" />
        </Storyboard>
        <Viewbox x:Key="snowTree" Width="20" Height="20">
            <Path Stroke="White" StrokeThickness="1" Fill="White" Data="M438.237 355.927l-66.574-38.54 59.448-10.327c5.846-1.375 10.609-5.183 13.458-10.13 2.48-4.307 3.506-9.478 2.524-14.651-2.11-11.115-12.686-18.039-23.621-15.467l-85.423 31.115L255.914 256l82.136-41.926 85.423 31.115c10.936 2.572 21.512-4.352 23.621-15.467 2.111-11.115-5.046-22.209-15.981-24.781l-59.448-10.327 66.573-38.54c9.54-5.523 12.615-18.092 6.867-28.074-5.748-9.982-18.14-13.596-27.68-8.074l-66.574 38.54 20.805-56.787c3.246-10.782-2.758-22.542-13.413-26.268-10.654-3.725-21.922 1.997-25.168 12.779l-15.838 89.735-72.423 41.926V136l69.585-58.621c7.689-8.21 6.997-20.856-1.548-28.245-8.545-7.391-21.705-6.723-29.394 1.486l-38.644 46.46V20c0-11.046-9.318-20-20.813-20s-20.813 8.954-20.813 20v77.08l-38.644-46.46c-7.689-8.21-20.849-8.876-29.394-1.486-8.544 7.389-9.236 20.035-1.547 28.245L203.187 136v83.853l-72.423-41.926-15.838-89.736c-3.247-10.782-14.515-16.504-25.169-12.779-10.656 3.725-16.659 15.486-13.413 26.268l20.805 56.787-66.573-38.54c-9.54-5.523-21.933-1.908-27.68 8.074s-2.673 22.551 6.867 28.074l66.574 38.54-59.449 10.328C5.953 207.515-1.202 218.609.907 229.724c2.11 11.114 12.686 18.038 23.622 15.466l85.422-31.115L192.086 256l-82.136 41.926-85.423-31.115c-10.936-2.572-21.511 4.352-23.622 15.466-2.109 11.113 5.046 22.209 15.981 24.781l59.449 10.328-66.574 38.54C.223 361.449-2.852 374.018 2.896 384s18.14 13.597 27.68 8.074l66.574-38.54-20.805 56.786c-1.735 5.764-.828 11.805 2.02 16.751 2.48 4.307 6.433 7.784 11.392 9.517 10.655 3.725 21.923-1.997 25.169-12.779l15.838-89.736 72.423-41.926V376l-69.585 58.621c-7.69 8.21-6.997 20.855 1.547 28.245 8.544 7.388 21.705 6.723 29.394-1.487l38.644-46.46V492c0 11.046 9.318 20 20.813 20s20.813-8.954 20.813-20v-77.081l38.644 46.46c4.111 4.389 9.782 6.621 15.478 6.621 4.96 0 9.939-1.694 13.916-5.134 8.545-7.39 9.237-20.035 1.548-28.245L244.813 376v-83.853l72.423 41.926 15.838 89.736c3.246 10.782 14.514 16.504 25.168 12.779 10.653-3.726 16.659-15.487 13.412-26.268l-20.805-56.787 66.574 38.54c9.54 5.523 21.933 1.908 27.68-8.074 5.749-9.981 2.675-22.55-6.866-28.072z" />
        </Viewbox>
        <Ellipse x:Key="snowEllipse" Width="4" Height="4" Canvas.Left="150" Canvas.Top="15" Opacity="0.4">
            <Ellipse.Fill>
                <RadialGradientBrush Center="0.5,0.5">
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="Transparent" Offset="1" />
                </RadialGradientBrush>
            </Ellipse.Fill>
            <Ellipse.Effect>
                <DropShadowEffect Color="White"  ShadowDepth="0" BlurRadius="25" />
            </Ellipse.Effect>
        </Ellipse>
    </UserControl.Resources>
    <TabControl metro:TabControlHelper.Underlined="TabPanel">
        <TabItem Header="路径动画">
            <ScrollViewer>
                <StackPanel>
                    <GroupBox Header="路径动画1" Margin="5">
                        <DockPanel>
                            <DockPanel DockPanel.Dock="Top" LastChildFill="False" Margin="5,2">
                                <Button x:Name="btnStart1" Content="开始" Click="btnStart1_Click" />
                                <Button x:Name="btnStop1" Content="停止"  Click="btnStop1_Click"/>
                                <Button x:Name="btnSnowWindow" Content="炸弹拆除" Click="btnSnowWindow_Click" />
                                <Button x:Name="btnWaveWindow" Content="3D水波" Click="btnWaveWindow_Click" />
                                <TextBlock x:Name="tbMsg1" />
                            </DockPanel>
                            <Canvas x:Name="canvas1" Margin="5" Height="200">
                                <Canvas.Background>
后面还有 146 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。