AppTaskContent Class

Definition

Represents the content displayed for an app task in the Windows Shell UI. Use this class to create different visual representations of task progress and results.

public ref class AppTaskContent sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Shell.Tasks.AppTaskContract, 65536)]
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppTaskContent final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Shell.Tasks.AppTaskContract), 65536)]
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppTaskContent
Public NotInheritable Class AppTaskContent
Inheritance
Object Platform::Object IInspectable AppTaskContent
Attributes

Windows requirements

Requirements Description
Device family
Windows Desktop Extension SDK (introduced in 10.0.26100.0)
API contract
Windows.UI.Shell.Tasks.AppTaskContract (introduced in v2.0)

Remarks

Important

App task support will start gradually rolling out to Windows 11 starting May, 2026. The experiences enabled by Windows.UI.Shell.Tasks APIs require that the corresponding app task feature be present in the version of Windows where the app runs. Otherwise, these APIs will not have any effect.

AppTaskContent can be constructed for different supported representations:

When a task needs user attention, additional elements can be added using SetQuestion, AddButton, or SetTextInput.

Using shell tasks APIs

Apps that use these APIs need to be packaged. See Packaging overview for more info.

You also need to add the com.microsoft.apptaskprovider AppExtension to your app manifest like this:

<Package
  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  IgnorableNamespaces="rescap uap uap3">
...

<Application>
  ...
  <Extensions>
    <uap3:Extension Category="windows.appExtension">
        <uap3:AppExtension
            Name="com.microsoft.apptaskprovider"
            PublicFolder="Public"
            Id="MyApp.AppTaskProvider"
            DisplayName="AppTaskProvider for MyApp"/>
    </uap3:Extension>
  </Extensions>
  ...
</Application>

...
</Package>

Properties

Name Description
MaxButtons

Gets the maximum number of buttons that can be added to task content.

Methods

Name Description
AddButton(String, Uri)

Adds a button to the task content that the user can click to take an action.

CreateGeneratedAssetsResult(AppTaskResultAsset[])

Creates task content that displays a collection of assets generated by the task.

CreatePreviewThumbnail(Uri, String)

Creates task content that displays a preview thumbnail of the task output.

CreateSequenceOfSteps(String[], String)

Creates task content that displays a sequence of steps showing task progress.

CreateTextSummaryResult(String)

Creates task content that displays a text summary of the task result.

SetQuestion(String)

Sets a question to display to the user when the task needs attention.

SetTextInput(String, String)

Sets up a text input field for the user to provide a free-form text response.

Applies to