You need to use DataTransferManager
to display a standard Share dialog and SetWebLink
method of DataRequest.Data
property to link to your app:
public sealed partial class MainPage : Page
{
private DataTransferManager dataTransferManager;
public MainPage()
{
this.InitializeComponent();
dataTransferManager = DataTransferManager.GetForCurrentView();
dataTransferManager.DataRequested += DataTransferManager_DataRequested;
}
private void DataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "Share the App";
request.Data.Properties.Description = "This App in Windows Store";
request.Data.SetWebLink(new Uri("https://www.microsoft.com/en-us/store/p/netflix/9wzdncrfj3tj"));
}
private void Button_Click(object sender, RoutedEventArgs e)
{
DataTransferManager.ShowShareUI();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.