다음을 통해 공유


AppNotificationButton.Content 속성

정의

AppNotificationButton의 단추 텍스트를 가져오거나 설정합니다.

public:
 property Platform::String ^ Content { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Content();

void Content(winrt::hstring value);
public string Content { get; set; }
var string = appNotificationButton.content;
appNotificationButton.content = string;
Public Property Content As String

속성 값

String

Platform::String

winrt::hstring

단추 텍스트가 포함된 문자열입니다.

예제

다음 예제에서는 이 속성을 사용하여 앱 알림 단추에 대한 단추 텍스트를 설정하는 방법을 보여 줍니다.

var args = new Dictionary<string, string>() { { "action", "reply" }, { "arg2", "value" } };
var button = new AppNotificationButton();
button.Content = "Reply";
button.Arguments = args;

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;arg2=value'/>
    </actions>
</toast>

설명

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

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

적용 대상