从Silverlight删除文件 [英] Deleting a file from silverlight
问题描述
我在查找如何从文件服务中删除文件时遇到麻烦.我创建了一个与 Silverlight 4拖放文件管理器非常相似的项目 [ // 将控件添加到可视树.
此 .LayoutRoot.Children.Add(controlName); I am having trouble finding out how to delete a file from a file service. I have made a project very similar to Silverlight 4 Drag and Drop File Manager[^]. Now I have added a delete button next to every file download hyperlink which should remove the file from the project by clicking on it.
以类似的方式,该控件可以通过以下方式动态删除:
// 删除现有控件.
此 .LayoutRoot.Children.Remove(controlName);
对于您的问题,可以使用此方法作为解决方案.
The problem is that I have tried various codes I could find on the internet and sadly I have not managed to find anything that works. Can someone help me with this? Any idea would help, since I am very new to silverlight and I am stuck.In SilverLight, therez a general methodology to add a control as:
// Add the control to the visual tree.
this.LayoutRoot.Children.Add(controlName);
In similar way, the control can be dynamically removed as:
// Delete the exisiting control.
this.LayoutRoot.Children.Remove(controlName);
For your problem, you can use this approach as the solution.
这篇关于从Silverlight删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!