首页 > 其他分享 >Wpf Beginstoryboard Storyboard DoubleAnimation Storyboart.TargetName,Storyboary.TargetProperty Repea

Wpf Beginstoryboard Storyboard DoubleAnimation Storyboart.TargetName,Storyboary.TargetProperty Repea

时间:2024-04-02 22:01:47浏览次数:19  
标签:function osciliations Storyboard elastic Beginstoryboard ease

<Window x:Class="WpfApp32.MainWindow"
        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"
        xmlns:local="clr-namespace:WpfApp32"
        mc:Ignorable="d" WindowState="Maximized"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <Button Content="Animation with Easing" Margin="8" FontSize="16">
                <Button.Triggers>
                    <EventTrigger RoutedEvent="Button.Click">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1500" From="20"  RepeatBehavior="Forever"
                                                 Storyboard.TargetName="e1"
                                                 Storyboard.TargetProperty="(Canvas.Left)"
                                                 Duration="0:0:1" AutoReverse="True"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="Button.Click">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1500" From="20" Storyboard.TargetName="e2"
                                                 Storyboard.TargetProperty="(Canvas.Left)" 
                                                 Duration="0:0:1" AutoReverse="True"
                                                 RepeatBehavior="Forever">
                                    <DoubleAnimation.EasingFunction>
                                        <CircleEase EasingMode="EaseInOut"/>
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="Button.Click">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1500" From="20" Storyboard.TargetName="e3"
                                                 Storyboard.TargetProperty="(Canvas.Left)"
                                                 Duration="0:0:1" AutoReverse="True"
                                                 RepeatBehavior="Forever">
                                    <DoubleAnimation.EasingFunction>
                                        <CircleEase EasingMode="EaseIn">
                                            
                                        </CircleEase>
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="Button.Click">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1500" From="20" Storyboard.TargetName="e4"
                                                 Storyboard.TargetProperty="(Canvas.Left)"
                                                 Duration="0:0:10" AutoReverse="True"
                                                 RepeatBehavior="Forever">
                                    <DoubleAnimation.EasingFunction>
                                        <ElasticEase x:Name="elasticEase" Oscillations="3"
                                                     Springiness="1" EasingMode="EaseOut"/>
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Button.Triggers>
            </Button>
        </StackPanel>
        <Canvas Grid.Row="1"  >
            <Ellipse Fill="Red" Stroke="Black" StrokeThickness="2"
                     Width="40" Height="40" Canvas.Left="20"
                     Canvas.Top="30" x:Name="e1"/>
            <Ellipse Fill="Green" Stroke="Black" StrokeThickness="2"
         Width="40" Height="40" Canvas.Left="20"
         Canvas.Top="160" x:Name="e2"/>
            <Ellipse Fill="Blue" Stroke="Black" StrokeThickness="2"
Width="40" Height="40" Canvas.Left="20"
Canvas.Top="260" x:Name="e3"/>
            <Ellipse Fill="Yellow" Stroke="Black" StrokeThickness="2"
Width="40" Height="40" Canvas.Left="20"
Canvas.Top="360" x:Name="e4"/>
        </Canvas>
    </Grid>
</Window>

 

 

 

标签:function,osciliations,Storyboard,elastic,Beginstoryboard,ease
From: https://www.cnblogs.com/Fred1987/p/18111596

相关文章

  • 【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode m
    问题描述ApplicaitonInsights收集了AzureFunction的日志,定期发现有”DrainModemodeenabledTraces“。DrainMode是什么意思呢? 问题解答排出模式(Drainmode) 属于FunctionApp 缩放机制中的一部分,当后台检测到FunctionApp请求量不再需要当前的instance时会停止对......
  • vue xxx.find is not a function;
    错误:1.后端获取数据集合,存到 vuex store 中和本地 window.localStorage;2.因为要解决刷新丢失问题在routeconfig中路由拦截重新 拿到本地数据window.localStorage 保存到store中;3.界面刷新报错:vuexxx.findisnotafunction分析:1.xxx类型确实不是数组;......
  • 【Azure Function & Application Insights】调用Function上传和下载文件,有时候遇见大
    问题描述在FunctionApp中配置了无代码模式的ApplicationInsights,但有时候发现,超过1MB的文件上传/下载操作成功。但是在ApplicationInsights中,却没有发现请求日志?这是一种什么情况呢? 问题解答ApplicationInsights 是具有采样功能的,当传入执行的速率超过指定的阈值时,Appl......
  • 当你遇到layer.alert is not a function怎么办
    下面我们来解决layer.alertisnotafunction的方法之一,下面来看一个GIS的例子,在登录之后,地图是加载出来的,当你点击区域定位是出现layer.alertisnotafunction。而我们的代码是没有bug,但是它还是报错。那是因为我们的url的地图出问题了,这是因为切图后的数据没有我们要的数......
  • std::function
    std::functional 是C++标准库中的一个模板类,它是对可调用对象的一种通用包装器。std::functional 允许你将任何可调用对象(包括函数、函数对象、lambda表达式、以及其他 std::functional 对象)当作一个统一的对象来处理。它通常与C++的算法库、容器库以及某些需要可调用对......
  • vuex.esm.js:135 Uncaught Error: [vuex] getters should be function but “getters.
    报错vuex.esm.js:135UncaughtError:[vuex]gettersshouldbefunctionbut"getters.mode"inmodule"userModule"is"dark".atassert(vuex.esm.js:135:1)原因:在使用vuex的moulds时index.js中已创建了一个vue实例newVuex.Store,在模块文件中又再创建了一个,导致报......
  • 【平台开发】MTK6833——add harware command queue function in lk
    CQE实现主要步骤(参考协议)Hostsystem结构commandqueue任务结构:2.TheoryofOperation(操作理论)init(初始化)初始化,enableCQ配置CQCFGTaskDescriptorsize配置CQTDLBA(CommandQueuingTaskDescriptorListBaseAddress)和CQTDLBAU(CommandQueuingTaskDe......
  • How to use the smb function of Babyfile App (connect Mac computer)
    1.Mac computer "SystemSettings"->"General"->"Sharing" reachthepagebelow(ordirectlysearchfor"FileSharing"onthesystemsettingspagetoreachthepage).Thenclickthebuttonshownin①2.Then......
  • Z_Function
    defz_func(s:str)->list:n=len(s)z=[0]*(n)l,r=0,0foriinrange(1,n):ifi<r:z[i]=min(r-i,z[i-l])whilei+z[i]<nands[z[i]]==s[i+z[i]]:z[i]+=1ifi+z[i]......
  • Flink 流数据处理 基于Flink1.12.0版本 MapFunction 只适用于一对一的转换,而 FlatMap
    Flink流数据处理基于Flink1.12.0版本MapFunction只适用于一对一的转换,而FlatMapFunction中可以一对多,或者多对一序言基于官网教程整理的一个教程。基于Flink1.12.0版本。目前该版本的Flink支持的source与sink如下所示参考资料:https://ci.apache.org/projects/flink......