Last active
May 24, 2018 01:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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