You can't compare a
string
to an
Image
The variable
a
is a
string
, and the variable
image1
is an
Image
. As far as the comparison is concerned, do you want to compare the images themselves, or just their locations?
If you hjust want to compare the locations, you can do this:
if (a == image1.Source.BaseUri.AbsolutePath)
{
}
EDIT ===============
Why was this answer voted 1? Was I wrong?