add gif support

This commit is contained in:
bluepilledgreat 2024-10-19 21:26:30 +01:00
parent 94b42c1cb8
commit f74ca0552f
2 changed files with 6 additions and 1 deletions

View File

@ -61,6 +61,7 @@
<PackageReference Include="securifybv.ShellLink" Version="0.1.0" />
<PackageReference Include="SharpZipLib" Version="1.4.2" />
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
<PackageReference Include="XamlAnimatedGif" Version="2.3.0" />
</ItemGroup>
<ItemGroup>

View File

@ -530,7 +530,11 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
throw new Exception($"Image Failed to create BitmapImage: {ex.Message}", ex);
}
image.Source = bitmapImage;
bool isAnimated = ParseXmlAttribute<bool>(xmlElement, "IsAnimated", false);
if (!isAnimated)
image.Source = bitmapImage;
else // we create the bitmapimage to check if the gif is valid
XamlAnimatedGif.AnimationBehavior.SetSourceUri(image, result);
}
ApplyTransformations_UIElement(image, xmlElement);