title: How to use SearchBox in Windows 8.1 by loading the results using a async method
body: <p>I am using a SearchBox to list some items that are obtained from the server.
  The call to the server is happening in a async method.</p>
  
  <p>I am getting an exception 
  An exception of type 'System.InvalidOperationException' occurred
  WinRT information: A method was called at an unexpected time.</p>
  
  <p>My XAML</p>
  
  <pre><code>&lt;SearchBox Name="SearchBox"
      Style="{StaticResource AccountSearchBoxStyle}"
      Grid.Row="1"
      Margin="120,0,0,0"
      HorizontalAlignment="Left"
      SuggestionsRequested="SearchBox_SuggestionsRequested"
      SearchHistoryEnabled="False" &gt; &lt;/SearchBox&gt;
  </code></pre>
  
  <p>My code behind</p>
  
  <pre><code>private async void SearchBox_SuggestionsRequested(SearchBox sender,
  SearchBoxSuggestionsRequestedEventArgs args){
  if (string.IsNullOrEmpty(args.QueryText))
  {
      return;
  }
  var collection = args.Request.SearchSuggestionCollection;
  if(oldquery != args.QueryText)
  {
      var listOfBanks = await addFIPageViewModel.GetBanksOnQuery();
      foreach (Institution insti in listOfBanks)
      {
          collection.AppendQuerySuggestion(insti.name);
      }
      oldquery = args.QueryText;
  }}
  </code></pre>