다음을 통해 공유


AppNotificationButton 생성자

정의

오버로드

AppNotificationButton()

AppNotificationButton 클래스의 새 instance 초기화합니다.

AppNotificationButton(String)

지정된 단추 텍스트를 사용하여 AppNotificationButton 클래스의 새 instance 초기화합니다.

AppNotificationButton()

AppNotificationButton 클래스의 새 instance 초기화합니다.

public:
 AppNotificationButton();
 AppNotificationButton();
public AppNotificationButton();
function AppNotificationButton()
Public Sub New ()

예제

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

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(new AppNotificationButton()
        .AddArgument("action", "reply"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='' arguments='action=reply'/>
    </actions>
</toast>

설명

AppNotificationBuilder.AddButton을 호출하여 앱 알림에 대한 xml 페이로드에 AppNotificationButton을 추가합니다.

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

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

적용 대상

AppNotificationButton(String)

지정된 단추 텍스트를 사용하여 AppNotificationButton 클래스의 새 instance 초기화합니다.

public:
 AppNotificationButton(Platform::String ^ content);
 AppNotificationButton(winrt::hstring const& content);
public AppNotificationButton(string content);
function AppNotificationButton(content)
Public Sub New (content As String)

매개 변수

content
String

Platform::String

winrt::hstring

단추에 표시되는 텍스트입니다.

예제

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

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(new AppNotificationButton("Reply")
        .AddArgument("action", "reply"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply'/>
    </actions>
</toast>

설명

AppNotificationBuilder.AddButton을 호출하여 앱 알림에 대한 xml 페이로드에 AppNotificationButton을 추가합니다.

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

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

적용 대상