I cannot bind a data property to IconFile in MapMarker

I am making a map with markers in different colors based on some criteria. This works fine:

                    <Each Items="{companies.companies}">
                        <MapMarker Latitude="{lat}" Longitude="{long}" Label="{name}" IconFile="../../assets/pin_green.png" />
                    </Each>

This, however, does not work:

                    <Each Items="{companies.companies}">
                        <MapMarker Latitude="{lat}" Longitude="{long}" Label="{name}" IconFile="{pin}" />
                    </Each>

In the last case, the app crashes, stating that the file was not found even though the value of that variable is exactly the same as in the string literal in the first example.

Found the solution here: https://www.fusetools.com/community/forums/howto_discussions/weird_path_error_when_databinding_to_filesource_ty?page=1