Pass the callback to handle the dialog result appropriately here.