다음을 통해 공유


AppNotificationBuilder.AddProgressBar(AppNotificationProgressBar) 메서드

정의

앱 알림에 대한 XML 페이로드에 진행률 표시줄을 추가합니다.

public:
 virtual AppNotificationBuilder ^ AddProgressBar(AppNotificationProgressBar ^ value) = AddProgressBar;
AppNotificationBuilder AddProgressBar(AppNotificationProgressBar const& value);
public AppNotificationBuilder AddProgressBar(AppNotificationProgressBar value);
function addProgressBar(value)
Public Function AddProgressBar (value As AppNotificationProgressBar) As AppNotificationBuilder

매개 변수

value
AppNotificationProgressBar

알림에 추가할 진행률 표시줄을 나타내는 AppNotificationProgressBar 입니다.

반환

추가 메서드 호출을 연결할 수 있도록 AppNotificationBuilder instance 반환합니다.

예제

다음 예제에서는 앱 알림에 콤보 상자를 추가하는 방법을 보여 줍니다.

var builder = new AppNotificationBuilder()
        .AddText("Downloading this week's new music...")
        .AddProgressBar(new AppNotificationProgressBar()
            .BindTitle()
            .BindValueStringOverride());

    var data = new AppNotificationProgressData(1 /* Sequence number */);
    data.Title = "Artist Name"; // Binds to {progressTitle} in xml payload
    data.Value = 0.5; // Binds to {progressValue} in xml payload
    data.ValueStringOverride = "1/2 songs"; // Binds to {progressValueString} in xml payload
    data.Status = "Downloading..."; // Binds to {progressStatus} in xml payload

    var notification = builder.BuildNotification();
    notification.Progress = data;

    AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Downloading this week&apos;s new music...</text>
            <progress title='{progressTitle}' status='{progressStatus}' value='{progressValue}' valueStringOverride='{progressValueString}'/>
        </binding>
    </visual>
</toast>

설명

AppNotificationProgressData의 필드를 바인딩하여 초기 값을 설정하고 진행률 표시줄의 상태 업데이트합니다. 앱 알림의 진행률 표시줄에 대한 데이터 바인딩에 대한 자세한 내용은 앱 알림 진행률 표시줄 및 데이터 바인딩을 참조하세요.

AppNotificationBuilder API를 사용하여 앱 알림에 대한 UI를 만드는 방법에 대한 지침은 앱 알림 콘텐츠를 참조하세요.

앱 알림에 대한 XML 스키마에 대한 참조 정보는 앱 알림 콘텐츠 스키마를 참조하세요.

적용 대상