question

EduardoGomez-1870 avatar image
0 Votes"
EduardoGomez-1870 asked KyleWang-MSFT commented

view model animation

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" />
dotnet-xamarin
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I want my SVG to scale when I enter this page

0 Votes 0 ·

@EduardoGomez-1870 Afraid that FFImageLoading not support “SVG animation”. Here is a similar thread you can refer to. About "SVG animation", maybe you can refer to this answer. Also, you can try to submit a feature request on github.

0 Votes 0 ·

0 Answers