async private void Login_Click(object sender, RoutedEventArgs e) { //// Do sign-in logic here and store your authentication token using the AppSettings class App.MyAppSettings.AuthTokenSetting = ServerApi.GetAuthTokenFromWebService(); App.MyAppSettings.UserIdSetting = ServerApi.GetUserIdFromWebService(); // log existing bindings { ContactBindingManager manager = await ContactBindings.GetAppContactBindingManagerAsync(); foreach (ContactBinding binding in await manager.GetContactBindingsAsync()) { Logger.Log("MainPage", "existing binding = " + binding.RemoteId); } } // Add contact bindings for every contact information that we get from the web service // This bindings will be automatically linked to existent phone contacts. // The auto-linking is based on name, email or phone numbers match. await CreateContactBindingsAsync(); // log new bindings { ContactBindingManager manager = await ContactBindings.GetAppContactBindingManagerAsync(); foreach (ContactBinding binding in await manager.GetContactBindingsAsync()) { Logger.Log("MainPage", "binding = " + binding.RemoteId); } } MessageBox.Show("Done!"); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); string[] uri = e.Uri.ToString().Split('='); if (uri.Length > 1) { bindingId = Uri.UnescapeDataString(uri[2]); } contactBindingManager = await ContactBindings.GetAppContactBindingManagerAsync(); EntityList.ItemsSource = await contactBindingManager.GetContactBindingsAsync(); EntityList.SelectionChanged += EntityList_SelectionChanged; }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); string[] uri = e.Uri.ToString().Split('='); if (uri.Length > 1) { bindingId = Uri.UnescapeDataString(uri[2]); } contactBindingManager = await ContactBindings.GetAppContactBindingManagerAsync(); EntityList.ItemsSource = await contactBindingManager.GetContactBindingsAsync(); EntityList.SelectionChanged += EntityList_SelectionChanged; }