Bug 25473 - await DisplayAlert not working with Xamarin.Forms in Windows Phone
Summary: await DisplayAlert not working with Xamarin.Forms in Windows Phone
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-17 09:59 UTC by Anubhav Ranjan
Modified: 2015-07-31 06:13 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
it is a sample to show bug on winphone (77 bytes, text/plain)
2014-12-18 00:15 UTC, Elvin
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Anubhav Ranjan 2014-12-17 09:59:07 UTC
One of our customer is facing issue with DisplayAlert when using Xamarin.Forms in Windows Phone

###Actual Result:
When Logout Button is clicked, the application just logs out without waiting for the user response.
However, the AlertDialog keeps on showing since it's waiting for the response.
https://drive.google.com/file/d/0B45y-r-jT35wOGQzVnllZWJSU00/view

###Expected Result:
When Logout Button is clicked, the application should wait for the user response.

###Sample Code:
            var logoutButton = new Button { Text = "Logout" };
            logoutButton.Clicked += async (sender, e) =>
            {
                var answer = await DisplayAlert("das", "das", "yes", "no");
                if (answer)
                    App.Logout();
            };

            Content = new StackLayout
            {
                BackgroundColor = Color.Gray,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {
					tableView, 
					logoutButton
				}
            };
Comment 2 Elvin 2014-12-18 00:15:48 UTC
Created attachment 9116 [details]
it is a sample to show bug on winphone

This attached LoginDemo project is absolutely token the Xamarin-samples project. Just added code that show DisplayAlert to user when clicking logout button.
Comment 3 Ram Chandra 2015-01-05 11:11:37 UTC
I have checked this issue and with the help of attached sample I am able to reproduce this issue.

Steps to reproduce:

1. Download the attached sample.
2. Build and deploy the sample.
3. log in with any credentials
4. Tap the log-out button

When I press the log out button on device/emulator, I observed that the application just logs out without waiting for the user response. 

Screencast: http://www.screencast.com/t/QHmKCO5mjMu

Debug logs: https://gist.github.com/RamChBachkheti/99b245c906048c52dcb2
IDE logs: https://gist.github.com/RamChBachkheti/4da402b936a72e646b38

Additional Info: I am getting this behavior with both device and emulator.I am not getting this behavior for android.

Please let me know if I can provide more info to this issue.

Environment Info:

Xamarin.Forms.1.2.3.6257
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   3.8.150.0 (10cfd178d55287f09c85f5a1e604dfe20889a40f)
Xamarin.Android   4.20.0.28 (ba9bbbdd44cfdc4bf485e8885bd2ad24fba525f7)
Xamarin.iOS   8.4.0.0 (840a925103a0bf4a856507f13d5eaee3c1579c2f)
Xamarin.iOS Unified Migration   1.0
Comment 4 Jason Smith [MSFT] 2015-02-13 06:56:27 UTC
We can no longer reproduce this in 1.3.4. If you still have issues please re-open
Comment 5 Elvin 2015-02-16 05:36:42 UTC
i updated my project to 1.3.4. But still have issue.

Please fix this issue. I can not upload my WP project for this reason.
Comment 6 Elvin 2015-02-16 05:38:56 UTC
and i could not open issue again. What to do me? Re create it?
Comment 7 Anubhav Ranjan 2015-02-16 07:05:17 UTC
Elvin, can you please attach the sample project where the issue is reproducible?
Comment 8 Elvin 2015-02-16 07:12:36 UTC
Ranjan, i have attached sample still. You can see it in the Attachments section...
Comment 9 J.C.Ködel 2015-04-14 20:13:31 UTC
Happening again in 1.4.1.6359
Comment 10 Elvin 2015-04-15 07:53:32 UTC
Happening in last releases. Will be it fixed?
If you see that it is not fixable bug so advise me alternative way.
Note that for this bug i must change all my project.
Comment 11 Elvin 2015-04-24 02:26:31 UTC
Brothers and sisters, can anyone answer me about this bug? It is critical bug. Please provide solution
Comment 12 Adam 2015-05-16 11:01:13 UTC
This happens only when you change the MainPage in Windows Phone. I can confirm it exists in the latest release of Xamarin.Forms.
Comment 13 Niels 2015-06-24 09:42:57 UTC
I can confirm this bug being present in 1.4.2. await DisplayAlert instantly returns false for me, without having clicked on a button.
Comment 14 Adam 2015-06-25 01:01:55 UTC
This bug is a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=27119

Which has just been marked as resolved and will be available in 1.4.4-pre1

DisplayActionSheet and DisplayAlert were both doing the same thing.
Comment 15 Elvin 2015-07-31 06:13:32 UTC
Bug fixed on 1.4.4. Thanks