locked
Xamarin FFImageLoading Svg Forms RRS feed

  • Question

  • User370364 posted

    Hi Guys

    I'm working with images svg type in xamarin forms.

    I try this code and it's working.

    but when i try to use this code with bindable property doesn't work.

    code in my viewmodel.

    I've also change the build of my svg file to Embedded Resource.

    Is there any best way to solve my problem guys? Thanks..

    Tuesday, September 11, 2018 4:31 AM

Answers

  • User369979 posted

    @rpdomingo_18 Where did you place your image file? If you embedded it in PCL, do not forget add the project and folder's name as prefix just like what you set in the XAML. Here is a simple project for you referring to.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, September 12, 2018 11:04 AM

All replies

  • User369979 posted

    Change your binding GuidesFilterImage's type to string will make it work. Modify your view model like:

    private string _guidesFilterImage;
    public string GuidesFilterImage
    {
        set { SetProperty(ref _guidesFilterImage, value); }
        get { return _guidesFilterImage; }
    }
    
    public DetailPageViewModel(INavigationService navigationService) : base(navigationService)
    {
        // Make sure this svg path is correct
        GuidesFilterImage = "resource://eDriveMobile.Resource.custom_icons_image.svg";
    }
    
    Wednesday, September 12, 2018 8:30 AM
  • User370364 posted

    @LandLu Thanks for response. I've already try your code. It's not working for me. I think .svg file didn't support for control?

    Wednesday, September 12, 2018 10:06 AM
  • User369979 posted

    @rpdomingo_18 Where did you place your image file? If you embedded it in PCL, do not forget add the project and folder's name as prefix just like what you set in the XAML. Here is a simple project for you referring to.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, September 12, 2018 11:04 AM