다음을 통해 공유


AppNotificationButton.Icon 속성

정의

AppNotificationButton의 아이콘을 가져오거나 설정합니다.

public:
 property Uri ^ Icon { Uri ^ get(); void set(Uri ^ value); };
Uri Icon();

void Icon(Uri value);
public System.Uri Icon { get; set; }
var uri = appNotificationButton.icon;
appNotificationButton.icon = uri;
Public Property Icon As Uri

속성 값

단추 아이콘의 URI입니다.

예제

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

var button = new AppNotificationButton("Reply")
    .AddArgument("action", "reply");
button.Icon = new Uri("ms-appx:///Images/Reply.png");

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(button)
    .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.SetIcon을 호출하여 앱 알림 단추의 아이콘을 설정할 수도 있습니다.

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

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

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

  • .png
  • .jpg
  • .svg

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

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

적용 대상