This is a migrated thread and some comments may be shown as answers.

animation while loading wcf service

3 Answers 22 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
cielo valdoz
Top achievements
Rank 1
cielo valdoz asked on 07 May 2010, 07:16 AM
Hi,

Im getting data from sql database using linq but it takes time before it completes the execution. I want to have a loading animation while calling the wcf service. Pls help.

Thanks

3 Answers, 1 is accepted

Sort by
0
Ross Wozniak
Top achievements
Rank 1
answered on 07 May 2010, 08:28 PM
Hi Cielo,

You may want to check out this post on my blog, which talks about displaying an ActivityControl every time a time-consuming operation is in progress.

You may also want to download the source code for my Task-It (Silverlight 4) application so you can step through what I am talking about in the blog.

Ross
0
cielo valdoz
Top achievements
Rank 1
answered on 11 May 2010, 04:59 AM
Hi,

Thanks for the reply. I can now display animations using storyboard while calling the service. I used same loading animation on Silverlight startup, but i want to have a percentage (%) value to determine the remaining percent.
    Private Sub PopulateOptions() 
 
        'chartLayout.Visibility = Visibility.Collapsed 
        'RadProgressBar1.Visibility = Visibility.Visible 
        LoadingPopUp.IsOpen = True 
        Loading.Visibility = Visibility.Visible 
 
        Me.timer = New System.Windows.Threading.DispatcherTimer() 
        Me.timer.Interval = TimeSpan.FromMilliseconds(10) 
        AddHandler Me.timer.Tick, New EventHandler(AddressOf Me.timer_Tick) 
        Me.timer.Start() 
 
        Dim mService As DashboardService.DashboardClient = New DashboardService.DashboardClient() 
        AddHandler mService.GetCategoryGroupCompleted, AddressOf webService_GetCategoryGroupCompleted 
        AddHandler mService.GetCategoryCompleted, AddressOf webService_GetCategoryCompleted 
        AddHandler mService.GetTerminalCompleted, AddressOf webService_GetTerminalCompleted 
        AddHandler mService.GetSalesPersonCompleted, AddressOf webService_GetSalesPersonCompleted 
 
        mService.GetCategoryGroupAsync() 
        mService.GetCategoryAsync() 
        mService.GetTerminalAsync() 
        mService.GetSalesPersonAsync() 
 
    End Sub 
 
    Private Sub webService_GetSalesPersonCompleted(ByVal sender As ObjectByVal e As DashboardService.GetSalesPersonCompletedEventArgs) Handles webService.GetSalesPersonCompleted 
        cmbSalesItemSalesPerson.ItemsSource = e.Result 
        cmbSalesItemSalesPerson.SelectedValuePath = "Code" 
        cmbSalesItemSalesPerson.DisplayMemberPath = "Name" 
 
        cmbTotalSalesSalesPerson.ItemsSource = e.Result 
        cmbTotalSalesSalesPerson.SelectedValuePath = "Code" 
        cmbTotalSalesSalesPerson.DisplayMemberPath = "Name" 
 
        timer.Stop() 
        chartLayout.Visibility = Visibility.Visible 
        If chkSalesItemOption.IsChecked Then ChartSalesItem.Visibility = Windows.Visibility.Visible 
        If chkTotalSalesOption.IsChecked Then ChartTotalSales.Visibility = Windows.Visibility.Visible 
 
        LoadingPopUp.IsOpen = False 
        Loading.Visibility = Visibility.Collapsed 
 
    End Sub 
 
    Private Sub timer_Tick(ByVal sender As ObjectByVal e As System.EventArgs) 
        'LoadingText.Text = stepSize + Me.stepSize & "%" 
        'stepSize += Me.stepSize '+ "%" 
    End Sub 

Thanks
0
Yavor Georgiev
Telerik team
answered on 13 May 2010, 03:32 PM
Hi Cielo,

 WCF operations don't really have a way to report on their progress. Please check out the following link: http://forums.silverlight.net/forums/p/169137/381135.aspx

All the best,
Yavor Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
cielo valdoz
Top achievements
Rank 1
Answers by
Ross Wozniak
Top achievements
Rank 1
cielo valdoz
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or