Silverlight RIA服务DomainDataSource,AutoLoad和RefreshInterval之间的关系

发布于 2024-10-05 10:41:17 字数 528 浏览 0 评论 0原文

我无法理解 DomainDataSource.AutoLoad 之间的关系 和 DomainDataSource.RefreshInterval。

如果我为给定的 DomainDataSource 启用 AutoLoad,则会查询服务器 以非常高的速度重复...这不是我想要的。

所以我将 RefreshInterval 设置为“00:00:10”(每 10 秒一次,对吗?) 数据根本没有加载。

如果我将 AutoLoad 设置为 true,则 RefreshInterval 的值似乎不会影响任何内容。

然后是 LoadDelay 属性,该属性似乎与 AutoLoad 相关, 但将其设置为 10 秒并不会减慢对服务器的重复查询。

情况变得更糟,因为我正在尝试的应用程序是基于导航的应用程序 每次加载页面时,即使您转到应用程序中的不同页面,似乎也会同时执行更多查询。

我肯定做错了什么,但我无法弄清楚是什么,因为我无法理解这些属性的具体细节。我阅读了 MSDN 文档,但这一次它们并没有真正帮助。

我希望这不是一个含糊的问题。

I'm having trouble understanding the relation between DomainDataSource.AutoLoad
and DomainDataSource.RefreshInterval.

If I enable AutoLoad for a given DomainDataSource, the server is being queried
repeatedly at a very high rate... this is not what I want.

So I set RefreshInterval to "00:00:10" (every 10 seconds right?) but then the
data is not loaded at all.

If I set AutoLoad to true, the value of RefreshInterval does not seem to affect anything.

And then there's the LoadDelay property, that one does seem to be related to AutoLoad,
but setting this to 10 seconds does not slow down the repeated queries to the server.

It gets even worse because the application I'm trying is a Navigation based application
and every time a page gets loaded, more queries seem to be executed at the same time, even when you go to a different page within the application.

I'm definatly doing something wrong, but I can't figure out what because I fail to understand the specifics of these properties. I read the MSDN docs, but for once they didn't really help.

I'm hope it's not to vague of a question.

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

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

发布评论

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

评论(1

谁与争疯 2024-10-12 10:41:17

MSDN揭示了一些亮点:

When AutoLoad is true, any property change affecting the load query
will automatically invoke a Load after the specified LoadDelay.
Examples of properties that impact the query are PageSize and
FilterOperator. Also, changes to dependency object collections, such as
FilterDescriptors and changes to the dependency properties on elements
contained in those collections, will affect the query and prompt
an automatic Load.

对于 RefreshInterval

When a non-zero TimeSpan is specified, a Load operation is automatically
invoked each time the interval elapses, as long as CanLoad is true. When
this property is set, a timer starts, regardless of the value of the
AutoLoad property or whether a Load has been executed previously

所以听起来 AutoLoad 和 RefreshInterval 根本没有直接关系。需要考虑的一件事是 CanLoad 属性,在很多情况下该属性都会设置为 false。这可能是阻止您的 RefreshInterval 工作的原因。如果 DomainContext 中的任何实体有待处理的更改,则 CanLoad 会设置为 false,这种情况有时可能会在您没有意识到的情况下发生。

DDS 的真正专家是 RIA 服务团队的成员。他们在 RIA 服务论坛上闲逛的次数比这里多得多,因此询问可能有好主意。

MSDN sheds some light:

When AutoLoad is true, any property change affecting the load query
will automatically invoke a Load after the specified LoadDelay.
Examples of properties that impact the query are PageSize and
FilterOperator. Also, changes to dependency object collections, such as
FilterDescriptors and changes to the dependency properties on elements
contained in those collections, will affect the query and prompt
an automatic Load.

and for RefreshInterval

When a non-zero TimeSpan is specified, a Load operation is automatically
invoked each time the interval elapses, as long as CanLoad is true. When
this property is set, a timer starts, regardless of the value of the
AutoLoad property or whether a Load has been executed previously

So it sounds like AutoLoad and RefreshInterval don't have a direct relation at all. One thing to consider is the CanLoad property, which gets set to false for many things. It may be what is preventing your RefreshInterval from working. CanLoad gets set to false if any entity in the DomainContext has pending changes, which can happen without you realizing it at times.

The real experts on DDS are members of the RIA Services team. They hang out on the RIA Services forums a lot more than here, so asking there might be a good idea.

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