[問題] SurfaceListBox提取選取的檔案路徑
請問該怎麼取呢
photo是SurfaceListBox的name
將檔案放入SurfaceListBox
foreach (string file in Directory.GetFiles(photoPuzzlesPath, "*.jpg"))
{
Image img = new Image();
img.Source = new BitmapImage(new Uri(file));
photo.Items.Insert(photo.Items.Count,img);
}
接下來就不知道怎麼取得選取的檔案的路徑了...
MessageBox.Show(photo.SelectedItem.ToString());
show出來的都是"System.Windows.Controls.ViewBox"
從photo. 找也找不到能取得路徑的方法@@
C#新手...麻煩各位了...謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.105.52