silverlight 加载动画(钟)

直接上代码:

Client.Controls.LoginLoading.xaml:

<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	x:Class="Client.Controls.LoginLoading"
	Width="150" Height="150">
    <UserControl.Resources>
        <LinearGradientBrush x:Key="ForegroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="CornflowerBlue" Offset="1"/>
            <GradientStop Color="Cyan"/>
        </LinearGradientBrush>
        <Storyboard x:Name="Big" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="Bigger">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="Small" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="Smaller">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:12" Value="360"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>

    <i:Interaction.Triggers>
        <i:EventTrigger>
            <ei:ControlStoryboardAction Storyboard="{StaticResource Big}"/>
            <ei:ControlStoryboardAction Storyboard="{StaticResource Small}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <Grid>
        <Rectangle Width="150" Height="150" RadiusX="150" RadiusY="150" >
            <Rectangle.Fill>
                <ImageBrush ImageSource="../Images/Background.png"/>
            </Rectangle.Fill>
        </Rectangle>
        <Grid x:Name="LayoutRoot">
            <ed:Arc ArcThickness="13" EndAngle="360" Stretch="None" UseLayoutRounding="False" Fill="{StaticResource ForegroundBrush}"/>
            <Ellipse Fill="{StaticResource ForegroundBrush}" Margin="25"/>
            <Ellipse Fill="{StaticResource ForegroundBrush}" Margin="70"/>
            <Path x:Name="Bigger" Fill="{StaticResource ForegroundBrush}" Margin="0,28,0,0" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Top" Width="16" Height="40" Data="M0,0 C3,7 8,17 8,26 C8,30 3,38 0,40 M0,0 C-3,7 -8,17 -8,26 C-8,30 -3,38 0,40" RenderTransformOrigin="0.5,1.3">
                <Path.RenderTransform>
                    <CompositeTransform/>
                </Path.RenderTransform>
            </Path>
            <Path x:Name="Smaller" Fill="{StaticResource ForegroundBrush}" Margin="0,39,0,0" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Top" Width="11" Height="28" Data="M0,0 C3,7 8,17 8,26 C8,30 3,38 0,40 M0,0 C-3,7 -8,17 -8,26 C-8,30 -3,38 0,40" RenderTransformOrigin="0.5,1.464">
                <Path.RenderTransform>
                    <CompositeTransform/>
                </Path.RenderTransform>
            </Path>
        </Grid>
    </Grid>
</UserControl>

引用的页面 *.xaml:

<Canvas x:Name="ContainerCanvas">
            </Canvas>

后台代码*.xaml.cs:

LoginLoading loginloading = new LoginLoading();
                ContainerCanvas.Children.Add(loginloading);




 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值