Share via


AppNotificationScenario 열거형

정의

앱 알림에 대한 시나리오를 지정합니다. 그러면 시스템에서 일부 알림 동작을 조정하여 지정된 시나리오에 대한 일관된 환경을 제공합니다.

public enum class AppNotificationScenario
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
enum class AppNotificationScenario
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
public enum AppNotificationScenario
var value = Microsoft.Windows.AppNotifications.Builder.AppNotificationScenario.default
Public Enum AppNotificationScenario
상속
AppNotificationScenario
특성

필드

Alarm 2

경보 시나리오입니다.

Default 0

기본 시나리오입니다.

IncomingCall 3

들어오는 호출 시나리오입니다.

Reminder 1

미리 알림 시나리오입니다.

Urgent 4

긴급한 시나리오입니다.

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드에서 알림 시나리오를 설정하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetScenario(AppNotificationScenario.Reminder)
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast scenario='reminder'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
</toast>

설명

AppNotificationBuilder.SetScenario를 호출하여 앱 알림 XML 페이로드에 대한 시나리오를 설정합니다.

긴급 시나리오 값은 Windows 10 빌드 19041 이상에서만 지원됩니다. IsUrgentScenarioSupported를 호출하여 현재 디바이스에서 긴급 시나리오가 지원되는지 런타임에 확인합니다.

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

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

적용 대상