AppNotificationProgressBar.SetValue(Double) Method

Definition

Sets the progress value of an app notification progress bar.

public:
 virtual AppNotificationProgressBar ^ SetValue(double value) = SetValue;
AppNotificationProgressBar SetValue(double const& value);
public AppNotificationProgressBar SetValue(double value);
function setValue(value)
Public Function SetValue (value As Double) As AppNotificationProgressBar

Parameters

value
Double

double

A double representing the progress value.

Returns

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

Examples

The following example illustrates how to set the Value 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.Value property.

The Value 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