public void OnDismiss(PopupEventArgs eventArgs) { if (Dismiss != null) { Dismiss(this, eventArgs); } }
protected void RegisterAction(Dictionary<string, object> action, string id) { object typeObj, valueObj; action.TryGetValue("value", out valueObj); if (action.TryGetValue("type", out typeObj)) { PopupEventArgs eventArgs = new PopupEventArgs(id, (string)typeObj, (string)valueObj); switch ((string)typeObj) { case "none": { _actions.Add(() => {}); break; } case "action": { _actions.Add(() => { if (valueObj != null) { _popup.OnAction(eventArgs); } _popup.Close(); }); break; } case "link": { _actions.Add(() => { _popup.OnAction(eventArgs); if (valueObj != null) { Application.OpenURL((string)valueObj); } _popup.Close(); }); break; } default : { // "dismiss" _actions.Add(() => { _popup.OnDismiss(eventArgs); _popup.Close(); }); break; } } } }
public void OnAction(PopupEventArgs eventArgs) { if (Action != null) { Action(this, eventArgs); } }