title: How to call a c# method of my windows store app from a background task in windows
body: <p>I have a background task in windows 8.1 metro style apps that constantly checking for internet by implementing  "IBackgroundTask" and made it to run only if internet is available. so my question is how can I call a C# method if the background Task is triggered.??
  Here is my code for background task</p>
  
  <pre><code>public sealed class CheckInternet : IBackgroundTask
  {
      public void Run(IBackgroundTaskInstance taskInstance)
      {
          BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
  
          //Check if BackGroudTask is already registered
          BackgroundTaskRegistration task = RegisterBackgroundTask(entryPoinnt, TaskName);
          task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
          //SendWorkOrdersToServer();
  
         _deferral.Complete();
      }
  }
  </code></pre>