public void Execute(object parameter) { SelectionCommandContext context = (SelectionCommandContext)parameter; var selection = context.PdfViewer.Document.Selection; Application.Current.MainPage.DisplayAlert("Selected Text", selection.GetSelectedText(), "OK"); lock (selection) { selection.Clear(); } }
private void GetSelectedTextCommandExecuted(object obj) { SelectionCommandContext context = (SelectionCommandContext)obj; var selection = context.PdfViewer.Document.Selection; Application.Current.MainPage.DisplayAlert("Selected Text", selection.GetSelectedText(), "OK"); lock (selection) { selection.Clear(); } }
public bool CanExecute(object parameter) { SelectionCommandContext context = parameter as SelectionCommandContext; return(context != null); }