Hello
I am trying to animate SVG, I created a binbeable property for a grid
internal class ImageScalingAnimationControl : SvgCachedImage
{
public static readonly BindableProperty IsRunningProperty = BindableProperty.Create(
nameof(IsAnimating),
typeof(bool),
typeof(Grid),
true
);
public bool IsAnimating
{
get => (bool)GetValue(IsRunningProperty);
set => SetValue(IsRunningProperty, value);
}
public ImageScalingAnimationControl()
{
Initialize();
}
internal async void Initialize()
{
while (IsAnimating)
{
await this.ScaleTo(1, 500);
}
}
}
}
And I am consuming it like
<controls:ImageScalingAnimationControl
Aspect="AspectFit"
HeightRequest="200"
HorizontalOptions="CenterAndExpand"
IsAnimating="True"
Source="{Binding FeelU.Image}"
VerticalOptions="CenterAndExpand"
WidthRequest="200" />