static UIPreviewAction PreviewActionForTitle(string title, UIPreviewActionStyle style = UIPreviewActionStyle.Default) { return(UIPreviewAction.Create(title, style, (action, previewViewController) => { var detailViewController = (DetailViewController)previewViewController; var item = detailViewController?.DetailItemTitle; Console.WriteLine("{0} triggered from `DetailViewController` for item: {1}", action.Title, item); })); }
static UIPreviewAction PreviewActionForTitle(string title, UIPreviewActionStyle style = UIPreviewActionStyle.Default) { return(UIPreviewAction.Create(title, style, (action, previewViewController) => { var peekViewController = (PeekViewController)previewViewController; if (style == UIPreviewActionStyle.Destructive) { // delete Console.WriteLine("#### Delete PA {0} ", action.Title); } else { //view Console.WriteLine("---- View PA {0} ", action.Title); } })); }