private static async void OnShowDialog(BindableObject bindable, object oldValue, object newValue) { var page = GetParent <Page>(bindable); bool showAlert = (bool)newValue; if (showAlert) { ActionSheetParameters args = GetParameters(bindable); if (page != null && args != null) { string result = await page.DisplayActionSheet(args.Title, args.Cancel, args.Destruction, args.Buttons); SetResult(bindable, result); // pass result back to binding SetShowDialog(bindable, false); // reset the dialog } } }
public static void SetParameters(BindableObject bindable, ActionSheetParameters value) { bindable.SetValue(ParametersProperty, value); }