Reputation: 437
I'm trying to save multiple contacts using the SaveContactTask class, i've got a loop that goes through contact information and creates a SaveContactTask object then i add the required data then I call the Show() method, in WP7 you can't call Show() multiple times until the dialog closes, is there anyway i can synchronize it so the loop waits till the dialog has closed and then continue adding the rest of the contacts i need added to the Phone?
Upvotes: 0
Views: 501
Reputation: 400
Store your created SaveContactTask objects in a list. After the first task is closed you've get redirected to your page and OnNavigatedTo is executed. Check here if your list has at least one member. Remove the first one and show it. Repeat until list is empty.
Rembember to save your task list because your app can be tombstoned.
Upvotes: 1