Share via


AppNotificationButton.IsButtonStyleSupported 메서드

정의

현재 디바이스의 앱 알림 단추에 단추 스타일이 지원되는지 여부를 나타내는 값을 반환합니다.

public:
 static bool IsButtonStyleSupported();
 static bool IsButtonStyleSupported();
public static bool IsButtonStyleSupported();
function isButtonStyleSupported()
Public Shared Function IsButtonStyleSupported () As Boolean

반환

Boolean

bool

True이면 단추 스타일이 지원됩니다. 그렇지 않으면 false입니다.

예제

다음 예제에서는 앱 알림 단추 스타일이 지원되는지 확인하고, 지원되는 경우 단추 스타일을 설정하는 방법을 보여 줍니다.

var button = new AppNotificationButton("Reply")
    .AddArgument("action", "reply");

if(AppNotificationButton.IsButtonStyleSupported())
{
    button.SetButtonStyle(AppNotificationButtonStyle.Critical);
}

var builder = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(button);

AppNotificationManager.Default.Show(builder.BuildNotification());

긴급 시나리오가 지원되는 경우 결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply' hint-toolTip='Click to reply.'/>
    </actions>
</toast>

설명

AppNotificationButton.SetButtonStyle 메서드를 사용하면 AppNotificationButtonStyle 열거형의 단추 스타일 중 하나를 지정하여 일반적인 시나리오에 일관된 환경을 제공할 수 있습니다. 이 기능은 Windows 10 빌드 19041 이상에서만 지원됩니다. 이 메서드를 사용하면 현재 디바이스에서 단추 스타일이 지원되는지 런타임에 확인할 수 있습니다.

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

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

적용 대상