当前位置: 首页 > news >正文

C# Avalonia 15- Animation- Easing

Easing.axaml代码

<Window xmlns="https://github.com/avaloniaui"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"Height="371" Width="499"x:Class="AvaloniaUI.Easing"Title="Easing"><Grid Background="White"><Button Width="300" Height="60" HorizontalAlignment="Center" Content="This button grows"><Button.Styles><Style Selector="Button"><Style.Animations><Animation Duration="0:0:3" FillMode="Forward"><KeyFrame Cue="0%"><Setter Property="Width" Value="400"/></KeyFrame><KeyFrame Cue="100%"><Setter Property="Width" Value="300"/></KeyFrame></Animation></Style.Animations></Style><Style Selector="Button:pointerover"><Style.Animations><Animation Duration="0:0:1.5" FillMode="Forward" Easing="ElasticEaseOut"><KeyFrame Cue="0%"><Setter Property="Width" Value="300"/></KeyFrame><KeyFrame Cue="100%"><Setter Property="Width" Value="400"/></KeyFrame></Animation></Style.Animations></Style></Button.Styles></Button></Grid>
</Window>

Easing.axaml.cs代码

using Avalonia;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;namespace AvaloniaUI;public partial class Easing : Window
{public Easing(){InitializeComponent();}}

运行效果

image

 

http://www.jsqmd.com/news/3616/

相关文章:

  • 安卓编译重点记录
  • kubelet源码阅读(二)——device plugin 的ListAndWatch过程
  • CyberLink ColorDirector Ultra 2026 14.0.5712.0 视频后期调色
  • CF 1053 Div.2
  • haproxy负载均衡 - 详解
  • ​​[硬件电路-320]:模拟电路与数字电路,两者均使用晶体管(如BJT、MOSFET),但模拟电路利用其线性区,数字电路利用其开关特性。 - 指南
  • 豆油
  • 源码安装fail2ban
  • 高效 PDF 处理利器:PDF-XChange Editor v10.7.3.401 特性解析与优化版分享
  • 类的继承与继承的覆盖
  • linux shell awk 中括号 方括号 分割 []
  • springboot配置文件关系及加载顺序
  • 绩效面谈中的优质提问(一)
  • 简单博弈
  • PolarFire SOC Auto Update 和 IAP 文档阅读一 AUTO recovery
  • 从 “纸笔清单” 到全栈引擎:数据填报与类 Excel 控件如何重塑企业效率曲线 - 详解
  • 触摸IC原厂 VKD223EB是一款低电流1通道触控1按键触摸芯片 HBM静电大于5KV
  • 09_五大IO模型
  • wsl Ubuntu 使用cmake
  • 做题笔记总板
  • AI元人文思想体系:从哲学基础到价值原语博弈的微观机制
  • 做题笔记16
  • 条件判断语句
  • 嵌入式铁头山羊STM32-各章节详细笔记-查阅传送门 - 教程
  • 深入解析:实验室:将 XSS 反映到 HTML 上下文中,大多数标记和属性都被阻止
  • EXCEL 行列转换
  • 深入解析:【Qt】信号和槽
  • 做题笔记6
  • 第17章 Day20-Day21 逆向爬虫之瑞数6
  • 基于多假设跟踪(MHT)算法的MATLAB实现