다음을 통해 공유


AppNotificationButton.SetIcon(Uri) 메서드

정의

AppNotificationButton의 아이콘을 설정합니다.

public:
 virtual AppNotificationButton ^ SetIcon(Uri ^ value) = SetIcon;
AppNotificationButton SetIcon(Uri const& value);
public AppNotificationButton SetIcon(System.Uri value);
function setIcon(value)
Public Function SetIcon (value As Uri) As AppNotificationButton

매개 변수

value
Uri Uri

단추 아이콘의 URI입니다.

반환

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

예제

다음 예제에서는 이 메서드를 사용하여 앱 알림 단추의 아이콘을 설정하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(new AppNotificationButton("Reply")
        .AddArgument("action", "reply")
        .SetIcon(new Uri("ms-appx:///Images/Reply.png")))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

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

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply' imageUri='ms-appx:///Images/Reply.png'/>
    </actions>
</toast>

설명

AppNotificationButton.Icon을 사용하여 앱 알림 단추의 아이콘을 설정할 수도 있습니다.

다음 스크린샷은 아이콘을 사용하는 앱 알림 단추를 보여 줍니다.

아이콘을 사용하는 단추가 있는 앱 알림의 스크린샷

지원되는 이미지 파일 형식은 다음과 같습니다.

  • .png
  • .jpg
  • .svg

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

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

적용 대상