There are several Image. Pressing the Image opens. How do I pass this window image, which I clicked?
image1.Source = new BitmapImage(new Uri();
...
imageN.Source = new BitmapImage(new Uri();
private void ShowPreview(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
PopupWnd ww=new PopupWnd();
ww.PopImage.Source = new BitmapImage(new Uri(??? need imageN));
ww.Show();
}
If I understood you properly than:
void _imageN_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var image = sender as Image;
var imageSource = image.Source as BitmapImage;
imageSource.BaseUri.ToString(); //here it is your Uri
}
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.