From f74ca0552f140def522e9301d4058435a7d28fcc Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 19 Oct 2024 21:26:30 +0100 Subject: [PATCH] add gif support --- Bloxstrap/Bloxstrap.csproj | 1 + Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Bloxstrap.csproj b/Bloxstrap/Bloxstrap.csproj index 3e54892..d92799b 100644 --- a/Bloxstrap/Bloxstrap.csproj +++ b/Bloxstrap/Bloxstrap.csproj @@ -61,6 +61,7 @@ + diff --git a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs index b6ccbad..9031584 100644 --- a/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs +++ b/Bloxstrap/UI/Elements/Bootstrapper/CustomDialog.Creator.cs @@ -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(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);