my question is, could I Binding string image to image source ? I have multiple image and the image will change on if condition. So:
Xaml on Xamarin forms:
<Image Source="{Binding someImage}" Aspect="Fill" Grid.Row="2"></Image>
Codebehind c#
public String someImage;
public String SomeImage
{
set
{
if (someImage != value)
{
someImage = value;
}
}
get
{
return someImage;
}
}
InitializeComponent part:
if(true)
{
someImage = "backgroundListViewGren.png";
}
else
{
someImage = "backgroundListViewRed.png";
}
the image is in "Images" folder on portable project
but this, doesn't work, maybe i wront something but I don't understand. Any solutions ?
I've tried with ImageSource and not string, but don't work too.
the image is in "Images" folder on portable project
This will not work. You should place them in each projects respective resource location – Emad