/// <summary> /// Creates a new UnitDialog that will allow the user to select a unit. /// </summary> /// <param name="context">Context.</param> /// <param name="units">Units.</param> public static AlertDialog Create(Context context, IEnumerable <Unit> units, EventHandler <Unit> unitSelectionEvent) { var adb = new IONAlertDialog(context); adb.SetTitle(Resource.String.pick_unit); adb.SetItems(UnitsToString(units), (obj, args) => { unitSelectionEvent(adb, units.ElementAt(args.Which)); }); adb.SetCancelable(true); return(adb.Create()); }