title: How to use async/await correctly to display Xamarin Forms ActivityIndicator
body: <p>I have code that gets executed when a <code>ListView</code> item is selected. Since this code can take a noticeable amount of time to execute I want to display an <code>ActivityIndicator</code> while it is running. </p>
  
  <p>I have read through a lot of posts about the <code>ActivityIndicator</code> and I believe I have it setup correctly. I'm pretty sure my problem is due to the running code blocking the UI thread since the UI freezes completely during the process. </p>
  
  <p>I've worked through every variation I have been able to find for using async/await with no luck so I'm assuming that I am still doing something incorrectly.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private ListItem selectedList;
  public ListItem SelectedList
  {
      get
      {
          return selectedList;
      }
      set
      {
          if (selectedList != value)
          {
              var oldValue = selectedList;
              selectedList = value;
              buildThisList();
          }
      }
  }
  
  private async void buildThisList()
  {
      StatusBarIsVisibile = true; 
      ThisList = Task.Run(async () =&gt;
      {
          return await buildBnBList(SelectedList, selectedLocation, 
                           thisYearList.ListId)
                           .ConfigureAwait(false);
      }).Result;  // 1.8 seconds
      StatusBarIsVisibile = false;
      ThisList.MainVM = this;
      ThisList.BuildView();
      PIShowListHeaderText = SelectedList.Title.Trim();
  }
  
  private async Task&lt;BnBList&gt; buildBnBList(ListItem pSelectedList, State pselectedLocation, int pListId)
  {
      BnBList newList = new BnBList(pSelectedList, pselectedLocation, pListId);
      List&lt;BirdsnBflysMaster&gt; bbfList = 
           App.BnBRepo.GetBirdsnBflys(selectedList.ListType); // 1.3 seconds
      Lists parentList = App.BnBRepo.GetAList(SelectedList.ListId); // .5 seconds
      BnBItem newBnBItem;
      foreach (BirdsnBflysMaster bbf in bbfList) // .4 seconds
      {
          newBnBItem = new BnBItem(parentList, bbf, selectedLocation, newList, thisYearList.ListId);
          newList.ListAll.Add(newBnBItem);
          if (newBnBItem.ListTypeID == "Bird")
          {
              ...
          }
          else
          {
              ...
          }
      }            
      return newList;
  }
  </code></pre>
  
  <p>So: </p>
  
  <ul>
  <li><code>buildThisList</code> gets called when the <code>SelectedList</code> property changes.</li>
  <li><code>buildThisList</code> calls <code>buildBnBList</code> which is the time consuming process.</li>
  <li><code>buildBnBList</code> has nothing in it that is done asynchronously.</li>
  <li><code>StatusBarIsVisible</code> is bound to both <code>IsVisible</code> and <code>IsRunning</code> of the <code>ActivityIndicator</code>.</li>
  </ul>
  
  <p>How can I code this so that executing <code>buildBnBList</code> does not block the UI thread?</p>