0
像我有圖像列表我添加一個圖標按鈕來刪除圖像,當它被選中,我必須把什麼樣的代碼刪除的內容圖像I創建PIC的稱爲圖像的文件夾如何去除WF7
List<Data> datasource = new List<Data>()
{
new Data()
{Text = "Chrysanthemum",ImageUri= "/Ima/Chrysanthemum.jpg"},
new Data()
{Text="Desert", ImageUri="/Ima/Desert.jpg"},
new Data()
{Text="Hydrangeas", ImageUri="/Ima/Hydrangeas.jpg"},
new Data()
{Text="Jellyfish", ImageUri="/Ima/Jellyfish.jpg"},
new Data()
{Text="Koala",ImageUri="/Ima/Koala.jpg"},
new Data()
{Text="Lighthouse", ImageUri ="/Ima/Lighthouse.jpg"},
new Data()
{Text="Penguins",ImageUri="/Ima/Penguins.jpg"},
new Data()
{Text="Tulips",ImageUri="/Ima/Tulips.jpg"}
};
this.listBox.ItemsSource = datasource;
private void delete_Click(object sender, EventArgs e)
{
if (listbox.selectedItem!= null)
................
}
我想創建圖片庫的列表,當圖片被選中時,我刪除從此列表中選擇的圖片 –
所以使用第一種方法 – RredCat