XamarinForms 101: How to use Acr.UserDialogs
Are you looking for a pop-up plugin that you can use for your Xamarin projects?
Want to see how Acr.UserDialogs work and some samples?
In this post, you will learn how to use Acr.UserDialogs Nuget package by Allan Richie through a step-by-step process.
The first step is to right-click on your Solution. Then go to Manage NuGet Packages for Solution.
On the browse tab, type acr user dialogs. Look for Acr.UserDialogs by Allan Ritchie.
Install the Acr.UserDialogs Nuget package on each project in your solution
Call UserDialogs.Init(this) on your Android project only. For iOS project, nothing is necessary any longer as of v4.x. There is an Init function for iOS but it is OPTIONAL and only required if you want/need to control the top level viewcontroller for things like iOS extensions. Progress prompts will not use this factory function though.
Let’s put it on MainActivity.cs of our Android project.
Create the UI for the Acr.UserDialogs sample functions.
Write your Acr.UserDialogs functionalities here.
And for the demo.
Here’s the sample code of Acr.UserDialogs.
Wrapping up, the cross-platform libraryAcr.UserDialogs has plenty to offer that allows you to call for standard user dialogs from a shared/portable library. It supports Android, iOS, and Unified Windows Platform (UWP, UAP). Try it and explore its other methods and properties.