zoukankan      html  css  js  c++  java
  • Silverlight杂记自定义loading

    Silverlight承载的页面中

          <param name="splashScreenSource" value="SilverlightLoader.xaml" />
            <param name="onSourceDownloadProgressChanged" value="appDownloadProgressChanged" />
            <param name="onSourceDownloadComplete" value="appDownloadComplete" />

    JS

    function appDownloadProgressChanged(sender, args) 
           { 
             
    var progressTextBlock = sender.findName("ProgressTextBlock");
             progressTextBlock.Text 
    = (Math.round(args.progress * 100)) + "%"
           }
           
    function appDownloadComplete(sender, args) { 
               alert(
    "appDownloadComplete"); 
           }

    image

    XAML

    <?xml version="1.0" encoding="utf-8" ?> 
    <Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
          xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"> 
        
    <Grid.Background> 
            
    <LinearGradientBrush> 
                
    <GradientStop Color="#FFFFFFFF" Offset="0.25" /> 
                
    <GradientStop Color="#FFFFAF00" Offset="1.5" /> 
            
    </LinearGradientBrush> 
        
    </Grid.Background> 
        
    <Grid.Triggers> 
            
    <EventTrigger RoutedEvent="Grid.Loaded"> 
                
    <BeginStoryboard> 
                    
    <Storyboard Storyboard.TargetName="EllipseRotateTransform" 
                                Storyboard.TargetProperty
    ="Angle"> 
                        
    <DoubleAnimation From="0" To="360" 
                                         BeginTime
    ="00:00:00" Duration="00:00:01" 
                                         RepeatBehavior
    ="Forever" /> 
                    
    </Storyboard> 
                
    </BeginStoryboard> 
            
    </EventTrigger> 
        
    </Grid.Triggers> 
        
    <Grid HorizontalAlignment="Center" 
                VerticalAlignment
    ="Center" 
                Height
    ="80" Width="80" Margin="10"> 
            
    <Ellipse x:Name="myEllipse" 
                     Stroke
    ="#FF000000" RenderTransformOrigin="0.5,0.5"> 
                
    <Ellipse.RenderTransform> 
                    
    <RotateTransform x:Name="EllipseRotateTransform" /> 
                
    </Ellipse.RenderTransform> 
                
    <Ellipse.Fill> 
                    
    <RadialGradientBrush GradientOrigin="0.06,0.8"> 
                        
    <RadialGradientBrush.RelativeTransform> 
                            
    <TranslateTransform X="-0.007" Y="0.008" /> 
                        
    </RadialGradientBrush.RelativeTransform> 
                        
    <GradientStop Color="#FFCAFFB4" Offset="0" /> 
                        
    <GradientStop Color="#FF39AF07" Offset="0.8" /> 
                        
    <GradientStop Color="#FF7BCE09" Offset="1" /> 
                    
    </RadialGradientBrush> 
                
    </Ellipse.Fill> 
            
    </Ellipse>
            
    <Ellipse Height="55" Width="55" 
                     Fill
    ="Plum" Stroke="#FF000000" /> 
            
    <TextBlock x:Name="ProgressTextBlock" 
                       Width
    ="55" Height="20" 
                       FontFamily
    ="Verdana" FontSize="14" 
                       Text
    ="0%" 
                       TextAlignment
    ="Center" /> 
        
    </Grid> 
    </Grid>

     

    loading界面

    image

    下载完成

    image
  • 相关阅读:
    矩阵树定理(Kirchhoff || Laplace)初探——Part 1(无向图计数)
    AC自动机——看似KMP在跑,其实fail在跳
    逆序数模板
    牛客暑期五几何题
    priority_queue()大根堆和小根堆(二叉堆)
    STL中去重函数unique
    简单判断long long 以内的回文数
    素数判断和素数筛(简单方便)
    记忆化递归
    map详细的复习
  • 原文地址:https://www.cnblogs.com/facingwaller/p/1917314.html
Copyright © 2011-2022 走看看