title: I want to run a method every minute that's started from my OnAppearing(). Do I need to run this as a task?
body: <p>Here's the code that I have come up with. It seems to work but I am concerned that it may not be good way to do what I want to do.  What I need is to run a method every minute as soon as the OnAppearing happens and have it stop with the OnDisappearing();</p>
  <pre><code>protected async override void OnAppearing()
  {
     base.OnAppearing();
     BindingContext = vm;
  
     cts = new CancellationTokenSource();
     if (Settings.mode == MO.Practice)
     {
        if (!App.stopWatch.IsRunning) { App.stopWatch.Start(); }
              Device.StartTimer(new TimeSpan(0, 0, 5), () =&gt;
        {
            if (App.stopWatch.IsRunning &amp;&amp; App.stopWatch.Elapsed.Seconds &gt;= 60)
            {
               // Here's the method I want to run. After it's finished
               // I call BeginInvoke .. to update info on the screen
               if (App.DB.ReducePoints() == true)
                  Device.BeginInvokeOnMainThread(() =&gt;
                  {
                     vm.PifInfo = GetPifInfo();
                  });
                  App.stopWatch.Restart();
               }
               return true;
              });
          }
          await GetCards(cts.Token);
      }
  }
  
  protected override void OnDisappearing()
  {
      Unsubscribe();
      cts.Cancel();
      if (App.stopWatch.IsRunning) { App.stopWatch.Stop(); }
      base.OnDisappearing();
  }
  </code></pre>
  <p>Not part of the question but I would welcome any comments on the code also.</p>