다음을 통해 공유


AppNotificationBuilder.SetTimeStamp(DateTime) 메서드

정의

앱 알림에 대한 사용자 지정 타임스탬프를 설정합니다.

public:
 virtual AppNotificationBuilder ^ SetTimeStamp(DateTime value) = SetTimeStamp;
AppNotificationBuilder SetTimeStamp(DateTime const& value);
public AppNotificationBuilder SetTimeStamp(System.DateTimeOffset value);
function setTimeStamp(value)
Public Function SetTimeStamp (value As DateTimeOffset) As AppNotificationBuilder

매개 변수

value
DateTime DateTimeOffset

사용자 지정 타임스탬프의 값을 지정하는 DateTimeOffset 값입니다.

반환

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

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드에서 사용자 지정 타임스탬프를 설정하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetTimeStamp(DateTimeOffset.Now)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast displayTimestamp='2022-10-25T15:54:31-07:00'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

다음 스크린샷은 사용자 지정 타임스탬프를 배치하는 것을 보여 줍니다.

사용자 지정 타임스탬프가 있는 앱 알림의 스크린샷

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

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

적용 대상