AppNotificationProgressBar.SetValue(Double) Methode

Definition

Legt den Statuswert einer App-Benachrichtigungsstatusanzeige fest.

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

Parameter

value
Double

double

Ein Doppelter, der den Statuswert darstellt.

Gibt zurück

Gibt die AppNotificationProgressBar-Instanz zurück, sodass zusätzliche Methodenaufrufe verkettet werden können.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie die Value-Eigenschaft einer App-Benachrichtigungsstatusleiste festgelegt wird.

 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);

Die resultierende XML-Nutzlast:

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

Hinweise

Sie können den Status auch mit der AppNotificationProgressBar.Value-Eigenschaft festlegen.

Der Wert ist standardmäßig gebunden. Aktualisieren Sie den gebundenen Statuswert, indem Sie der Eigenschaft AppNotification.Progressein AppNotificationProgressData-Objekt zuweisen.

Anleitungen zur Verwendung der AppNotificationBuilder--APIs zum Erstellen der Benutzeroberfläche für App-Benachrichtigungen finden Sie unter App-Benachrichtigungsinhalt.

Referenzinformationen zum XML-Schema für App-Benachrichtigungen finden Sie unter App-Benachrichtigungsinhaltsschema.

Gilt für: