Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET WCF WPF Silverlight
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();
 
}
Posted 20-Mar-13 10:42am
Sider89812
Edited 20-Mar-13 10:43am
v2
Comments
Sider89 at 21-Mar-13 6:42am
   
here is this simple project, where I suffer with this busy indicator
 
http://www.mediafire.com/?pdd99yyju2b4rjp
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I suggest trying their forums:
http://www.telerik.com/community/forums.aspx[^]
They have great support people who specialize in their software.
  Permalink  
Comments
Sider89 at 20-Mar-13 16:10pm
   
I tried their forums.
But they said, that I must present them purchase license. My company have bought it and so I have not it.. and they avoid my questions
Sider89 at 21-Mar-13 5:49am
   
???
wizardzz at 21-Mar-13 10:31am
   
That was my input. I'm not a servant. I'm not being paid to research an answer for you. Go ask your company for the license. If they bought it, they have it.
Keith Barrow at 21-Mar-13 10:40am
   
I don't see what the problem is. If you have Telerik-specific problems then the Telerik forums are more likely to help.
If they require the license and your company has it then you need to get in touch with the person in your company and get the key to get help. If your company doesn't have a license (even a trial one) and you are trying to use the controls then you are committing an act of software piracy. They aren't going to help you if you try and pirate their software.
jim lahey at 21-Mar-13 11:21am
   
This answer cannot be improved any further.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
Sider89 at 21-Mar-13 11:05am
   
No, everything is well, beside the BusyIndicator, Bindings is correct and have result too. Problem is that BusyIndicator dose not display.
http://www.mediafire.com/?pdd99yyju2b4rjp here is link, there is simple project, if you check it you'll see that everything is fine, beside that BusyIndicator
Pete O'Hanlon at 21-Mar-13 11:24am
   
I'm not here to debug your project for you. I don't have Telerik installed on my machines, so it would not be ethical for me to install one of their controls just to look at this. And seriously, from the code you posted, it can't possibly work. Check the scope of your CustList and then ask yourself how it can contain any data when you've just created it.
 
What you need to do is add a breakpoint into this method and step into it. Actually inspect things - that's what you're expecting us to do for you after all.
Sider89 at 21-Mar-13 11:51am
   
yes, this is in MVVM..
public ObservableCollection(customermodel) Customers
{ get { return _Customers; }
set {
if (_Customers != value){
_Customers = value;
}
}
}
private ObservableCollection(customermodel) _Customers;
 

private void LoadData()
{
App.Instance.SetBusy();
 

proxy.ServicesClient client = new proxy.ServicesClient();
 
client.GetCustomersCompleted += (s, e) =>
{
if (e.Error != null)
{
throw new Exception();
}
else
{
Customers = new ObservableCollection();
foreach (var item in e.Result)
{
Customers.Add(new CustomerModel()
{
CustomerId = item.CustomerId,
Title = item.Title,
FirstName = item.FirstName,
MiddleName = item.MiddleName,
LastName = item.LastName,
CompanyName = item.CompanyName,
SalesPerson = item.SalesPerson,
EmailAddress = item.EmailAddress,
Phone = item.Phone
});
}

 
OnPropertyChanged("Customers");
 

App.Instance.UnSetBusy();
};
 
client.GetCustomersAsync();
client.Close();
 
}
 
here is the fragment, it works. binding, evrithing ... not only busyindicator
Pete O'Hanlon at 21-Mar-13 12:18pm
   
Does your SetBusy and UnSetBusy method actually raise the property change notification though? I assume that you are binding to the IsBusy property and using the BooleanToVisibilityConverter to control whether or not the indicator is displaying.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 235
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100