Telerik RadBusyIndi​​cator无法在WPF中显示 [英] Telerik RadBusyIndicator dose not display in WPF

查看:185
本文介绍了Telerik RadBusyIndi​​cator无法在WPF中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WPF项目中使用WCF服务,该项目生成异步方法。在开始检索信息之前,我设置busyIndi​​cator isBusy =true。在事件中的异步方法之后,例如GetCustomersCompleted + =(s,e)=> {set IsBusy =false}。

但是在完成所有这些疯狂之后,BusyIndi​​cator无法显示。为什么?有什么问题?



这里是代码的代码片段:

  private   void  LoadData(){

ServiceClient proxy = new ServiceClient();
IsBusy = true ;
proxy.GetCustomersCompleted + =(s,e)= >
{
ObservableCollection< CustomerModel> CustList = new ObservableCollection< CustomerModel>();

foreach var item in CustList)
{
CustList.Add( new CustomerModel()
{
FirstName = item .firstname,
LastName = item.lastname,
// 依旧......
});
}

IsBusy = false ;
};
proxy.GetCustomersAsync();
proxy.Close();

}

解决方案

我建​​议尝试他们的论坛:

http://www.telerik.com/community/forums.aspx [ ^ ]

他们非常支持那些专注于他们软件的人。

这里缺少几个位。你在这里使用MVVM吗?如果是这样,您的IsBusy属性是否会提出更改通知?我还在你完成的处理程序中看到了很大的问题 - 你创建一个空的可观察集合,然后迭代它。你永远不会在那里得到任何结果。此外,由于这是在本地范围内,您将无法绑定到可观察的集合。如何从已完成的事件处理程序中取消引用。


I am using WCF services in my WPF project, which generates async methods. well before begins retrieve information, I set busyIndicator isBusy = "true". After async method in event, for example GetCustomersCompleted+=(s, e)=>{ set IsBusy = "false" }.
But after all of this madden, BusyIndicator dose not display. why? what is the problem?

here is code fragment of code:

private void LoadData(){

    ServiceClient proxy = new ServiceClient();
    IsBusy = true;
    proxy.GetCustomersCompleted += (s, e)=>
    {
        ObservableCollection<CustomerModel> CustList = new ObservableCollection<CustomerModel>();
        
        foreach(var item in CustList)
        {
              CustList.Add(new CustomerModel()
                                  {
                                        FirstName = item.firstname,
                                        LastName = item.lastname,
                                       //and so on ...
                                  });
        }
     
        IsBusy = false;
    };
    proxy.GetCustomersAsync();
    proxy.Close();

}

解决方案

I suggest trying their forums:
http://www.telerik.com/community/forums.aspx[^]
They have great support people who specialize in their software.


You are missing several bits here. Are you using MVVM here? If so, does your "IsBusy" property raise change notification? I also see big problems in your completed handler - you create an empty observable collection and then you iterate over it. You''re never going to get any results in there. Also, as this is scoped locally, you aren''t going to be able to bind to the observable collection. How do you dereference from your completed event handler.


这篇关于Telerik RadBusyIndi​​cator无法在WPF中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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