从Silverlight删除文件 [英] Deleting a file from silverlight

查看:66
本文介绍了从Silverlight删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在查找如何从文件服务中删除文件时遇到麻烦.我创建了一个与 Silverlight 4拖放文件管理器非常相似的项目 [ // 将控件添加到可视树. .LayoutRoot.Children.Add(controlName);



以类似的方式,该控件可以通过以下方式动态删除:

 // 删除现有控件.
     .LayoutRoot.Children.Remove(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.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆