我可以在页面的不同区域重复使用 Silverlight 应用程序吗?

发布于 2024-07-18 07:57:33 字数 169 浏览 6 评论 0原文

我有一个 Silverlight 应用程序,我想将其显示在网格中。 Silverlight 应用程序显示其内容的方式取决于每个网格行中记录的唯一 ID。 不幸的是,网格中的每一行都会重新下载 XAP 文件。 由于大小为 700KB,这确实会影响性能。 是否可以下载 XAP 文件一次,然后将其重新用于网格中的每一行?

I've got a single Silverlight app that I'd like to display in a grid. The way the Silverlight app displays its content is dependent on the unique ID of the record in each grid row. Unfortunately, the XAP file is re-downloaded for each row in the grid. With a size of 700KB, this really impacts performance. Is it possible to download the XAP file once and then just re-use it for each row in the grid?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寻找我们的幸福 2024-07-25 07:57:34

我不确定你可以。 理论上它应该被缓存,但在这种情况下,理论似乎不值得抢占。

这一切都取决于 << 对象> 标签的行为与它的各种参数有关,这是(另一个)silverlight“稀疏”记录的区域之一。

I'm not sure you can. Theoretically it should be cached, but in this case theory don't seem worth squat.

It's all down to the way the < object > tag behaves with it's various params and this is (another) one of the "sparsely" documented areas of silverlight.

执妄 2024-07-25 07:57:34

这是可能的,但不容易做到。 您可以下载 xap 并将其保存到isolatedStorage,并在每次需要引用缓存的 xap 时创建一个 silverlight 主机,但您只有 1MB 可用空间,并且不能保证您是否有来自同一域的其他 silverlight 应用程序。

鉴于您所描述的内容,我仍然认为做您想做的事情没有任何价值。 我认为你搞反了。

It is possible but not easy to do. You could download the xap and save it to IsolatedStorage and create a silverlight host each time you need one referencing your cached xap but you only have 1MB space available and you aren't guaranteed that if you have other silverlight apps from the same domain.

Given what you described I still don't see any value in doing what you want to do. I think you have it backwards.

狂之美人 2024-07-25 07:57:33

下载 XAP 后,Silverlight 将在每个 Silverlight 控件实例的本地缓存程序集等。 如果您创建 Silverlight 控件的另一个实例,那么该实例又具有它自己的域,并依次照顾该域。

我的建议是抽象出您需要的部分并将它们烘焙到单独的 xaml 中,然后将它们加载到您最需要的区域。 如果您仍然需要一个中央 .xap 来处理编组/事件管理等,那么在 Silverlight 3 中,我们放置了一个本地连接 API,它允许其他 Silverlight 实例在本地浏览器页面内相互通信(即 SilverlighA 可以与SilverlightB 的对话都在index.html 中),

这样您就可以建立某种本地代理(如果您愿意的话)。

Scott Barnes / 丰富平台产品经理 / Microsoft。

Once a XAP is downloaded Silverlight will cache the assemblies etc locally per instance of a Silverlight control. If you create another instance of a Silverlight control then this in turn has it's own domain that it in turn looks after.

My suggestion is to abstract out the parts you requrie and bake them into a seperate xaml, then load them into areas where you need them the most. If you still require a central .xap to handle the marshalling / event management etc then in Silverlight 3 we've put in place a Local Connection API which allows other Silverlight instances to talk to one another within the one browser page locally (ie SilverlighA can talk to SilverlightB all within index.html)

This can then allow you to establish a sort of local proxy if you will.

Scott Barnes / Rich Platforms Product Manager / Microsoft.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文