dotnet / docs-maui

This repository contains documentation for .NET Multi-platform App UI (MAUI).
https://docs.microsoft.com/dotnet/maui
Creative Commons Attribution 4.0 International
226 stars 198 forks source link

MAUI Share Text/ File functionality Clarification #840

Closed hemant149 closed 2 years ago

hemant149 commented 2 years ago

Hi,

Below help article describes how we can use the .NET Multi-platform App UI (.NET MAUI) to share Text/URL or File.

https://docs.microsoft.com/en-us/dotnet/maui/platform-integration/data/share?tabs=android

Can you please tell what is Second Parameter in below ShareText task and what values should I pass ( ??? in call link) while making call to async Task ShareText.

Call Link

MudIconButton Icon="@Icons.Material.Filled.Share" Color="Color.Error" OnClick='@((e) => ShareText("Hello Share Text", **???** ))' 

Task

public async Task ShareText(string text, IShare share)
{
    await share.RequestAsync(new ShareTextRequest
    {
        Text = text,
        Title = "Share Text"
    });
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

adegeo commented 2 years ago

Hi. This article is missing a key piece of information, which is that an instance of IShare is available from the Microsoft.Maui.ApplicationModel.DataTransfer.Share.Default property.