• A Rotating Wireframe Cubesilverilght4简易魔方


    <UserControl x:Class="SilverlightApplication1.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" xmlns:my="clr-namespace:Liquid;assembly=Liquid.Popup" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
        <UserControl.Resources>
            <Style TargetType="Rectangle" x:Key="rectangleStyle">
                <Setter Property="Width" Value="200" />
                <Setter Property="Height" Value="200" />
                <Setter Property="Stroke" Value="Blue" />
                <Setter Property="StrokeThickness" Value="4" />
            </Style>
        </UserControl.Resources>

        <Grid x:Name="LayoutRoot" Background="White">
            <Grid HorizontalAlignment="Center"
                  VerticalAlignment="Center">
                <Rectangle Style="{StaticResource rectangleStyle}" Fill="Red" Opacity="0.5">
                    <Rectangle.Projection>
                        <PlaneProjection x:Name="front"
                                         LocalOffsetZ="100"
                                         RotationX="30" />
                    </Rectangle.Projection>
                </Rectangle>

                <Rectangle Style="{StaticResource rectangleStyle}" Fill="Yellow" Opacity="0.5">
                    <Rectangle.Projection>
                        <PlaneProjection x:Name="top"              
                                         LocalOffsetZ="100"
                                         RotationX="-60" />
                    </Rectangle.Projection>
                </Rectangle>

                <Rectangle Style="{StaticResource rectangleStyle}"  Fill="Blue" Opacity="0.5">
                    <Rectangle.Projection>
                        <PlaneProjection x:Name="bottom"
                                         LocalOffsetZ="100"
                                         RotationX="120" />
                    </Rectangle.Projection>
                </Rectangle>

                <Rectangle Style="{StaticResource rectangleStyle}" Fill="Green" Opacity="0.5">
                    <Rectangle.Projection>
                        <PlaneProjection x:Name="back"
                                         LocalOffsetZ="-100"
                                         RotationX="30" />
                    </Rectangle.Projection>
                </Rectangle>
            </Grid>
        </Grid>

        <UserControl.Triggers>
            <EventTrigger>
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="front"
                                         Storyboard.TargetProperty="RotationY"
                                         By="360" Duration="0:0:8"
                                         RepeatBehavior="Forever" />

                        <DoubleAnimation Storyboard.TargetName="top"
                                         Storyboard.TargetProperty="RotationY"
                                         By="360" Duration="0:0:8"
                                         RepeatBehavior="Forever" />

                        <DoubleAnimation Storyboard.TargetName="bottom"
                                         Storyboard.TargetProperty="RotationY"
                                         By="360" Duration="0:0:8"
                                         RepeatBehavior="Forever" />

                        <DoubleAnimation Storyboard.TargetName="back"
                                         Storyboard.TargetProperty="RotationY"
                                         By="360" Duration="0:0:8"
                                         RepeatBehavior="Forever" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </UserControl.Triggers>

    </UserControl>

  • 相关阅读:
    堆(优先队列)模板
    线段树(递归)模板
    快速幂(含二阶方阵类)模板
    ACM/CF赛制getstart模板
    [Andrew Stankevich's Contest#21] Lempel-Ziv Compression
    [NOIP2001]Car的旅行路线
    [NOIP2007] 矩阵取数游戏
    [NOIP2010] 关押罪犯
    [NOIP1999] 拦截导弹
    设计模式之第1章-工厂方法模式(Java实现)
  • 原文地址:https://www.cnblogs.com/chuncn/p/1749440.html
Copyright © 2020-2023  润新知