1.Nuget引用库AnimatedImage.Avalonia,项目路径:https://github.com/whistyun/AnimatedImage
2.axaml代码
<UserControl 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"
xmlns:anim="https://github.com/whistyun/AnimatedImage.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AvaloniaDemo.Pages.Gif" Background="White">
<Image anim:ImageBehavior.AnimatedSource="avares://AvaloniaDemo/Assets/Images/Bomb.gif"/>
</UserControl>
3.预览