다음을 통해 공유


AppNotificationBuilder.SetDuration(AppNotificationDuration) 메서드

정의

앱 알림의 기간을 설정합니다.

public:
 virtual AppNotificationBuilder ^ SetDuration(AppNotificationDuration duration) = SetDuration;
AppNotificationBuilder SetDuration(AppNotificationDuration const& duration);
public AppNotificationBuilder SetDuration(AppNotificationDuration duration);
function setDuration(duration)
Public Function SetDuration (duration As AppNotificationDuration) As AppNotificationBuilder

매개 변수

duration
AppNotificationDuration

앱 알림 기간을 지정하는 AppNotificationDuration 열거형의 값입니다.

반환

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

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드의 기간을 설정하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetDuration(AppNotificationDuration.Long)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast duration='long'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

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

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

적용 대상