我有控制其中负载从外部服务数据。这工作正常,但控制要么没有任何数据或完整的数据。加载控制数据从外部
我将如何实现增加额外的模式为“加载”和“错误加载”(或大意的东西)
我知道我大概可以使用OnPropertyChange告诉数据是否发生了变化,如何将这些控件我拿起下载失败了吗?
目前,我做这样的事
wc.OpenReadCompleted += Feed;
wc.OpenReadAsync(new Uri(formattedFeedUrl));
...
private void Feed(object Sender, OpenReadCompletedEventArgs e)
{
if (e.Error != null)
{
return; // here I want to notify that there's a download error somehow to the usercontrol
}
using (Stream s = e.Result)
{
// here I populate the ObservableCollection and notifychange
// and somewhere here, if the xml does not generate any data i want to notify a control also.
有什么技术,我可以用它来显示加载/错误的通知,而不是一个无人居住的控制,如果有一个的ServiceControl,而不是一个简单的用户控件,其有3个国家将工作。有没有办法根据绑定来控制状态?