Not able to show the gif from viewmodel in xamarin forms

judsonabrahamjudsonabraham USMember ✭✭✭
edited June 3 in Xamarin.Forms

I'm try to show gif in UWP xamarin forms app. So I want to bind the source of the gif from my viewmodel. I tried some code but I get NullReferenceException. So this my xaml code-

<Image HeightRequest="200" HorizontalOptions="Center" Source="{Binding SaveGif,Mode=TwoWay}" VerticalOptions="Center" WidthRequest="200" />
This is my code in viewmodel-

public ICommand SaveGif { get; set; }

SaveGif.Execute("Assets/checkmark_new.gif");

The exception occurs after it hit SaveGif.Execute code. Maybe there is some other approach to show the gif. Any suggestions?

Best Answer

Answers

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    An ImageSource is not an ICommand.

Sign In or Register to comment.