public override async Task <PersistentObject> Execute(object option) { var idx = Array.IndexOf(Options, (string)option); if (idx == Options.Length - 1) { return(await addAction.Execute(-1).ConfigureAwait(false)); } return(await newAction.Execute(idx).ConfigureAwait(false)); }
internal virtual async Task OnActionCommand(ActionBase action, object obj) { await action.Execute(null); }
internal override async Task OnActionCommand(ActionBase action, object obj) { if (action.Options != null && action.Options.Length > 0) { var button = obj as Button; if (button != null) { var popupMenu = new PopupMenu(); foreach (var option in action.Options) popupMenu.Commands.Add(new UICommand(option, async c => await action.Execute(c.Label))); var point = button.TransformToVisual(null).TransformPoint(new Point(button.ActualWidth, 0d)); await popupMenu.ShowAsync(point); return; } } await action.Execute(null); }