Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Last active May 24, 2018 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/2c40c4347d23c5d60a45137b5b1a3f4c to your computer and use it in GitHub Desktop.
Save juucustodio/2c40c4347d23c5d60a45137b5b1a3f4c to your computer and use it in GitHub Desktop.
Example how copy text to clipboard in Xamarin.Forms applications. - http://julianocustodio.com/clipboard
using Plugin.Clipboard;
using System;
using Xamarin.Forms;
namespace ClipboardDemo
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private async void Copy(object sender, EventArgs e)
{
CrossClipboard.Current.SetText(Mensagem.Text);
await DisplayAlert("Atenção", "O Texto \""
+ CrossClipboard.Current.GetText()
+ "\" foi copiado.", "OK");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment