mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
dont create a bitmapimage for gifs
This commit is contained in:
parent
23d8bb1aaa
commit
605db3cc0f
@ -523,6 +523,9 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
|||||||
if (result == null)
|
if (result == null)
|
||||||
throw new Exception("Image Source uri is null");
|
throw new Exception("Image Source uri is null");
|
||||||
|
|
||||||
|
bool isAnimated = ParseXmlAttribute<bool>(xmlElement, "IsAnimated", false);
|
||||||
|
if (!isAnimated)
|
||||||
|
{
|
||||||
BitmapImage bitmapImage;
|
BitmapImage bitmapImage;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -533,12 +536,13 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
|||||||
throw new Exception($"Image Failed to create BitmapImage: {ex.Message}", ex);
|
throw new Exception($"Image Failed to create BitmapImage: {ex.Message}", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isAnimated = ParseXmlAttribute<bool>(xmlElement, "IsAnimated", false);
|
|
||||||
if (!isAnimated)
|
|
||||||
image.Source = bitmapImage;
|
image.Source = bitmapImage;
|
||||||
else // we create the bitmapimage to check if the gif is valid
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
XamlAnimatedGif.AnimationBehavior.SetSourceUri(image, result);
|
XamlAnimatedGif.AnimationBehavior.SetSourceUri(image, result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ApplyTransformations_UIElement(image, xmlElement);
|
ApplyTransformations_UIElement(image, xmlElement);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user