我有一个图像列表我添加了一个图标按钮以在选择图像时删除图像,我必须输入什么代码来删除内容图像我创建了一个名为 Images 的图片文件夹
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)
................
}