title: Communication between Background(periodic task) and foreground app in windows phone7?
body: <p>I am new to Windows Phone 7.</p>
  
  <p>I am developing a project in wp7, in that project for every 60 sec I need to send my latitude longitude details to web service(asmx).  </p>
  
  <p>I have a background service and am connect to asmx service to it. when I update my details on asmx need to show toast message on phone, but I unable to do it, plz help me</p>
  
  <p>here is my background service code</p>
  
  <pre><code>          protected override void OnInvoke(ScheduledTask task)
                 {
  
          watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
          watcher.Start();
          string useremail = task.Description.ToString();
          string latitude = watcher.Position.Location.Latitude.ToString();
          string longitude = watcher.Position.Location.Longitude.ToString();
  
          ServiceReference1.UpdateUserLocationSoapClient obj = new ServiceReference1.UpdateUserLocationSoapClient();
          obj.UpdateUserLocation1Completed += new EventHandler&lt;ServiceReference1.UpdateUserLocation1CompletedEventArgs&gt;(obj_UpdateUserLocation1Completed);
          obj.UpdateUserLocation1Async(useremail, latitude, longitude);   
          // If debugging is enabled, launch the agent again in one minute.
          #if DEBUG_AGENT
          ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(5));
          #endif
  
          // Call NotifyComplete to let the system know the agent is done working.
          NotifyComplete();
      }
  </code></pre>
  
  <p>private void obj_UpdateUserLocation1Completed(object sender,                         ServiceReference1.UpdateUserLocation1CompletedEventArgs e)
          {</p>
  
  <pre><code>        ShellToast toast = new ShellToast();
  
  
  
          toast.Title = "kk";
          toast.Content = "ss" + e.Result.ToString();
          toast.Show();
  
  
      } 
  </code></pre>