有几张图片。按图像打开。如何通过我点击的窗口图像?
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();
}
答案 0 :(得分:0)
如果我理解你的话比:
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
}