Exemplo n.º 1
0
        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
                }
            }
        }
Exemplo n.º 2
0
 public static void SetParameters(BindableObject bindable, ActionSheetParameters value)
 {
     bindable.SetValue(ParametersProperty, value);
 }