Skip to content

Instantly share code, notes, and snippets.

@TBertuzzi
Last active November 3, 2020 13:35
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 TBertuzzi/e823e9062e0e45fa6d3720c3d3517225 to your computer and use it in GitHub Desktop.
Save TBertuzzi/e823e9062e0e45fa6d3720c3d3517225 to your computer and use it in GitHub Desktop.
Share
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace XamarinShareExemplo
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
async void btnShareText_Clicked(object sender, System.EventArgs e)
{
await Share.RequestAsync(new ShareTextRequest
{
Text = entryTexto.Text,
Title = "Deseja compartilhar o Texto com"
});
}
async void btnShareUrl_Clicked(object sender, System.EventArgs e)
{
await Share.RequestAsync(new ShareTextRequest
{
Uri = entryUrl.Text,
Title = "Deseja compartilhar a Url com"
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment