本文整理匯總了C#中Xamarin.Forms.Page.DisplayActionSheet方法的典型用法代碼示例。如果您正苦於以下問題:C# Page.DisplayActionSheet方法的具體用法?C# Page.DisplayActionSheet怎麽用?C# Page.DisplayActionSheet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Xamarin.Forms.Page
的用法示例。
在下文中一共展示了Page.DisplayActionSheet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PickImage
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;
}
示例2: AskOkCancel
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;
}