How do I create an if statement which checks the image source. Here is my code:
public void WhoWon()
{
if (UserPick.Source ="ms-appx:Assets/RPS3.png")
{
}
}
The error says
cannot implicitly convert from string to wundows.ui.blahblah.media.change..
Two questions:
How do I fix this exception?
How do I do check if the imagesource changed?
You should be able to know when the image source has changed by subscribing to the Image.ImageOpened Event .
Comparing for equality takes two equal signs, not one which assigns a value
if (UserPick.Source == "ms-appx:Assets/RPS3.png")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.