Freigeben über


AppNotificationProgressBar.SetStatus(String) Methode

Definition

Legt den Statustext einer App-Benachrichtigungsstatusleiste fest.

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

Parameter

value
String

Platform::String

winrt::hstring

Eine Zeichenfolge, die den Statuswert enthält.

Gibt zurück

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

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie sie die Status--Eigenschaft einer Statusanzeige einer App-Benachrichtigung festlegen.

 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 eigenschaft AppNotificationProgressBar.Status festlegen.

Der wert Status ist standardmäßig gebunden. Aktualisieren Sie den gebundenen Statuswert, indem Sie dem AppNotification.Progress-Eigenschaft ein 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: