Windows Phone Async - Calling the same routine more than once
Posted on 2012-03-21
I am writing a windows phone app [total rookie at it, fyi].
I am having difficulty understanding how this whole async thing works...
The .Net I am familiar with allows me to create a routine [maybe a function] and call that function as many times as I want, possibly even passing in variables as needed.
I am not so sure this is how it works in windows phone:
App > Routine > Web Service [Asyc?] > Get Some Data > Routine > Display The Data.
I am attempting to call the same Web Service Method more than once in the same Class [one page in Windows Phone App] by passing in two different variables at separate times. But the results are always the same result rendered on screen.
I have a textblock1 and a textblock2. I am attempting to populate each textblock with different data by calling the same web server method, but by passing in different variables.
The result should look something like this in the app:
But it renders like this:
What am I missing [I am sure it is alot]?
Why cant I call the same routine twice from the same page?
I am also sure that my terminoligy when it raltes to web services and such is incorrect, so I apologize in advance.
Here is the code from the xaml.vb page:
[For some reason I am unable to select the 'code' tag from the menu above. sigh]
Partial Public Class EnterScores
Dim srv As New ServiceReference1.Service1Client
Dim objAuthTokenDBHelper As New AuthTokenDBHelper
Dim objAuthUSerDBHelper As New AuthUserDBHelper
Public Sub New()
Dim strPlayerID As String = objAuthUSerDBHelper.GetLocalAuthUserID()
AddHandler srv.GetAuthenticatedPlayerInfoCompleted, AddressOf GetPlayerInfo
Private Sub btnSubmitGame_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
Private Sub GetPlayerInfo(sender As Object, e As ServiceReference1.GetAuthenticatedPlayerInfoCompletedEventArgs)
tbAuthenticatedPlayer.Text = e.Result.Item(0).FullName
Private Sub GetOpponentInfo(sender As Object, e As ServiceReference1.GetAuthenticatedPlayerInfoCompletedEventArgs)
tbOpponent.Text = e.Result.Item(0).FullName
Protected Overrides Sub OnNavigatedTo(e As System.Windows.Navigation.NavigationEventArgs)
Dim strOpponentID As String = NavigationContext.QueryString("Opponent").ToString
AddHandler srv.GetAuthenticatedPlayerInfoCompleted, AddressOf GetOpponentInfo