Last active
November 3, 2020 13:35
-
-
Save TBertuzzi/e823e9062e0e45fa6d3720c3d3517225 to your computer and use it in GitHub Desktop.
Share
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 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