-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Dialog #34
Comments
Hi. Unfortunately you can't. Once a choice is clicked, the dialog dismisses and returns the string that was selected. May I ask why you needed the click events and what are you trying to achieve? |
Hi. What i am trying to achieve is the click event of one dialog triggers a next dialog. So i taught there was a click event that was associated with the Dialog control |
You can check the returned string value of the dialog. It returns |
This is what i am attempting to do :
|
Hi, my mistake. var actions = new string[] { "Test1", "Test2" };
var result = MaterialDialog.Instance.SelectActionAsync("Select an option", actions);
if(result >= 0)
{
switch(actions[result])
{
case "Test1":
MethodForSomething();
break;
case "Test2":
MethodForSomethingElse();
break;
}
} You can also use this. var actions = new string[] { "Test1", "Test2" };
var result = MaterialDialog.Instance.SelectActionAsync("Select an option", actions);
switch(result)
{
case -1:
MethodForNoAction();
break;
case 0:
MethodForSomething();
break;
case 1:
MethodForSomethingElse();
break;
} |
Would i have to Dispose() of the previous dialog to see the new one?? I added a method with the same code:
and i am not seeing this dialog when i tapped on "Test1" |
No need to call dispose, the dialog automatically disposes when it is dismissed. var result = await MaterialDialog.Instance.SelectActionAsync("Select an option", actions); |
This is the code i have
No new dialog appears |
Hi. After some investigation, I saw the problem. The result is being returned but before showing the next dialog, it was dismissed immediately since the disappearing animation of the first dialog was still not finished. |
Ok thats good because i taught i was misusing the library. Is is possible to allow the animation of the first dialog to disappear on click? |
Yes, I already have a solution. The dialog will first dismiss before it will return the result. The current implementation is that the result was first returned before dismissing the dialog. To ensure that the old dialogs are removed from the modal stack before returning a result and showing another dialog of the same type, a delay of I can release a new version may be later this day. |
Will test when its released |
Tested it, works as expected. Any further issue i will update accordingly. |
This is more of a question than a issue, how do i get the click events on each of the string in
The text was updated successfully, but these errors were encountered: