public static async Task<bool> AskOkCancel(Page page, string msg, string yesText, string noText) { var result = await page.DisplayActionSheet (msg, noText, null, new[]{ yesText }); return result == yesText; }
public static async Task<IImage> PickImage(Page parent) { IImage image = null; string[] titles = null; if (_mediaPicker.IsCameraAvailable) { titles = new string[] { AppResources.LabelFromCamera, AppResources.LabelFromLibrary }; } if (titles != null) { if (parent != null) { var action = await parent.DisplayActionSheet(AppResources.TitlePickImage, AppResources.ButtonCancel, null, titles); if (action == AppResources.LabelFromCamera) { image = await takePicture(true); } else if (action == AppResources.LabelFromLibrary) { image = await takePicture(false); } } } else { image = await takePicture(false); } return image; }