private async void Context_FetchDataComplete(object sender, FetchDataCompleteEventArgs e) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(async() => { LocateOnSwitch.Toggled += LocateOnSwitch_Toggled; SearchBox.TextChanged += SearchBox_TextChanged; //SearchBox.SuggestionChosen += SearchBox_SuggestionChosen; SearchBox.QuerySubmitted += SearchBox_QuerySubmitted; SearchBox.IsEnabled = true; LocateOnSwitch.IsEnabled = true; FetchComplete.Begin(); CitiesList.ItemsSource = Context.Info; await AccesstoLocate(); })); }
/// <summary> /// Send a request /// </summary> /// <param name="uri">The Uri the request is sent to</param> /// <param name="completeCallback">A callback for completion event</param> /// <returns>True if request success, false otherwise</returns> public bool SendGetRequest(Uri uri, FetchComplete completeCallback = null) { return(SendRequest(uri, HttpMethod.Get, null, completeCallback)); }