Example on progress while calling WCF ?

7 posts, 0 answers
  1. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 19 Sep 2008 Link to this post

    Hello,
    On my usercontrol load, I do a call to a WCF service to get some data.
    There is a small delay while doing this, so I thought by using the progressbar while getting the data.

    I find examples on the web using WebClient to do this, but I want to use this using a async call eg:

    proxy.GetMyContextInfoCompleted += (sender2, e2) =>  
                {  
                    C = e2.Result;  
                     
                };  
     
                proxy.GetMyContextInfoAsync(); 
    Any ideas on how to do this ?

    Thanks,
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Oct 2008 Link to this post

    Hello Nicolas,

    My apologies with the much delayed answer. So - what type of progress you need to display. Do you have the percent value that you want to display of you want something that will loop endlessly until you tell it to stop?

    Did you check the online examples for the RadProgressBar?

    http://demos.telerik.com/silverlight

    All the best,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 08 Oct 2008 Link to this post

    Hi Valentin,
    Thanks for your anwser.
    I was able to solve this myself a while ago.

    Regards,
    Nicolas
  5. Kamachi
    Kamachi avatar
    1 posts
    Member since:
    Mar 2009

    Posted 19 Mar 2009 Link to this post

    Hi Nicolas,

    How did you solve the problem, I am trying to do the same display an progress bar while the app is waiting for response from WCF call. Any inputs would be appreciated.

    thanks,

    Ravi
  6. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 07 Apr 2009 Link to this post

    Hi Ravi,
    Typically I do a small increase of the progressbar using a Timer during the Async call. When the async call is completed I update the progressbar to it's max value :-)

    void usrCtrlChangePassword_Loaded(object sender, RoutedEventArgs e)  
    {  
       grdDetail.Visibility = Visibility.Collapsed;  
       rpbProgress.Visibility = Visibility.Visible;  
        
       this.timer = new System.Windows.Threading.DispatcherTimer();  
       this.timer.Interval = TimeSpan.FromMilliseconds(10.0);  
       this.timer.Tick += new EventHandler(timer_Tick);  
       this.timer.Start();  
                  
       ADDCInfo.DomainControllerInfoClient DIC = new ADPwdChange.ADDCInfo.DomainControllerInfoClient();  
                DIC.getDomainControllersCompleted += new EventHandler<ADPwdChange.ADDCInfo.getDomainControllersCompletedEventArgs>(DIC_getDomainControllersCompleted);  
                DIC.getDomainControllersAsync();  

     void timer_Tick(object sender, EventArgs e)  
            {  
                rpbProgress.Value += 50;  
            }  
     
            void DIC_getDomainControllersCompleted(object sender, ADPwdChange.ADDCInfo.getDomainControllersCompletedEventArgs e)  
            {  
                List<myDomainController> myDCList = new List<myDomainController>();  
                myDCList = e.Result;  
                rcbDomain.DataContext = myDCList;  
                rcbDomain.ItemsSource = myDCList;  
     
                var query = (from p in myDCList where p.Description == "EMEA" select p).FirstOrDefault();  
                rcbDomain.SelectedItem= query;  
     
                this.timer.Stop();  
                rpbProgress.Value = rpbProgress.Maximum;  
                grdDetail.Visibility = Visibility.Visible;  
                rpbProgress.Visibility = Visibility.Collapsed;  
     
            } 
  7. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 14 Sep 2009 Link to this post

    Excuse me NS,
    the way you've provided doesn't relate to the lenght of the wcf response size...it's almost a progress without real proportion...am I right?
    Thanks
    Paolo
  8. balaji
    balaji avatar
    69 posts
    Member since:
    May 2009

    Posted 27 Oct 2009 Link to this post

    Hi There,
    I Too Have the Same Problem.
    Like mi need to Display the Progress bar until the Response time of WCF Service.
    Help Appreciated.
    Thanks
    Regards
    N.Balaji
Back to Top
DevCraft banner