Share via


AppNotificationProgressBar.SetStatus(String) Method

Definition

Sets the status text of an app notification progress bar.

public:
 virtual AppNotificationProgressBar ^ SetStatus(Platform::String ^ value) = SetStatus;
AppNotificationProgressBar SetStatus(winrt::hstring const& value);
public AppNotificationProgressBar SetStatus(string value);
function setStatus(value)
Public Function SetStatus (value As String) As AppNotificationProgressBar

Parameters

value
String

Platform::String

winrt::hstring

A string containing the status value.

Returns

Returns the AppNotificationProgressBar instance so that additional method calls can be chained.

Examples

The following example illustrates how to set the Status property of an app notification progress bar.

 var notification = new AppNotificationBuilder()
    .AddText("Downloading your weekly playlist...")
    .AddProgressBar(new AppNotificationProgressBar()
        .SetTitle("Progress bar title")
        .SetValue(.5)
        .SetStatus("Downloading...")
        .SetValueStringOverride("1/2 files downloaded"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

The resulting XML payload:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Downloading your weekly playlist...</text>
            <progress title='Progress bar title' status='Downloading...' value='0.5' valueStringOverride='1/2 files downloaded'/>
        </binding>
    </visual>
</toast>

Remarks

You can also set the status with the AppNotificationProgressBar.Status property.

The Status value is bound by default. Update the bound status value by assigning an AppNotificationProgressData object to the AppNotification.Progresss property.

For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.

For reference information about the XML schema for app notifications, see App notification content schema.

Applies to