So, I'm kind of new to Xamarin, and I'm trying to figure out how to display a pop-up that has a user-text-input field in it. DisplayAlert doesn't do it because it doesn't have a text-input field. What should I use?
3 Answers
You can using DisplayPromptAsync. It is from Xamarin Forms, without other plugins.
string result = await DisplayPromptAsync("Question 1", "What's your name?");
1 Comment
bcr
This is the best answer because it uses only "inside the box" functionality.
You should try Acr.UserDialogs
NuGet: https://www.nuget.org/packages/Acr.UserDialogs/
GitHub Repo: https://github.com/aritchie/userdialogs
3 Comments
prinsJoe
So, I downloaded and installed the nuget package into xamarin, how do i call the method that brings up the dialog?
Peyman
@JoeDev If you checkout the git repo, they have good examples. This one particularly shows how you can use it. github.com/aritchie/userdialogs/blob/master/src/Samples/Samples/…
Peyman
@JoeDev To make it clear, I didn't mean git "checkout", I meant check out :)
I personally love this nuget (source on github) which allows you to use PopupPage xaml view inside a popup and elegantly as it adds the following methods that look very familiar with what we're all used to:
Navigation.PushPopupAsync()
Navigation.PopPopupAsync()
Navigation.PopAllPopupAsync()
Navigation.RemovePopupPageAsync()
3 Comments
dotnetdevcsharp
I love this however what I dont see is how to return a variable form the page i think that is what the person is trying to acehieve.
Korayem
@rogue39nin moving data between views is a common pattern that has its own techniques that'll work with the above approach normally. No need for anything special to achieve that. Same rules apply.
dotnetdevcsharp
Like microsoft they always leave out nice we simple things like an input dialog but great thank you solved my issue though my dialog is comming up full screen dont no why its a page popup was wanting it to be just a popup.
