在Silverlight中自动刷新 [英] Auto refresh in Silverlight

查看:62
本文介绍了在Silverlight中自动刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个Xaml页面,上面有一个保存"按钮.
在后面的代码中,我具有保存"按钮的Click事件.

点击逻辑完成后,我希望页面自动刷新.

我该如何实现?


谢谢您的帮助.
Chetan.

Hey guys,

I have a Xaml Page which has a Save Button on it.
In the code behind I have the Click event for the Save Button.

After the click logic is completed I want the page to be refreshed automatically.

How do I achieve that?


Thank you for all your help.
Chetan.

推荐答案

您要刷新页面是什么意思? Silverlight不像HTML ...没有页面刷新.如果您的数据绑定正确,页面是否应该立即反映新数据?
What do you mean you want to refresh the page? Silverlight is not like HTML... there is no page refresh. If you have your data bound correctly, shouldn''t the page instantly reflect the new data?


您可以使用DispatcherTimer事件.

请参见此处 [
You could use a DispatcherTimer event.

see here[^]


您需要在每次刷新时调用Web服务.

如果正确实现了INotifyPropertyChanged ,则每次服务调用返回到客户端应用程序(并且您的数据已更改)时,您都应该能够在页面上看到刷新的数据.
You need to call your web service everytime you need to do a refresh.

If you have implemented INotifyPropertyChanged correctly, you should be able to see data refreshed on the page everytime the service call returns to the client application (and your data has changed).


这篇关于在Silverlight中自动刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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