Share via


AppNotificationButton 클래스

정의

앱 알림에 표시되는 단추를 나타냅니다.

public ref class AppNotificationButton sealed
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.AppNotifications.Builder.IAppNotificationButtonFactory, 65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppNotificationButton final
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.AppNotifications.Builder.IAppNotificationButtonFactory), 65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppNotificationButton
function AppNotificationButton(content)
Public NotInheritable Class AppNotificationButton
상속
Object Platform::Object IInspectable AppNotificationButton
특성

예제

다음 예제에서는 앱 알림에 대한 XML 페이로드에 단추를 추가하는 방법을 보여 줍니다.

var notification = new AppNotificationBuilder()
    .AddText("Send a message.")
    .AddTextBox("textBox")
    .AddButton(new AppNotificationButton("Send")
        .AddArgument("action", "sendMessage"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

결과 XML 페이로드:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Send a message.</text>
        </binding>
    </visual>
    <actions>
        <input id='textBox' type='text'/><action content='Send' arguments='action=sendMessage'/>
    </actions>
</toast>

설명

AppNotificationBuilder.AddButton을 호출하여 앱 알림에 대한 XML 페이로드에 단추를 추가합니다. 단일 앱 알림에 최대 5개의 단추를 추가할 수 있습니다.

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

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

생성자

AppNotificationButton()

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

AppNotificationButton(String)

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

속성

Arguments

AppNotificationButton과 연결된 인수를 가져오거나 설정합니다.

ButtonStyle

단추의 스타일을 가져오거나 설정합니다.

Content

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

ContextMenuPlacement

앱 알림 상황에 맞는 메뉴 내에 단추가 표시되는지 여부를 지정하는 값을 가져오거나 설정합니다.

Icon

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

InputId

AppNotificationButton의 입력 ID를 가져오거나 설정합니다.

InvokeUri

앱 알림 단추를 클릭할 때 시작되는 URI를 가져오거나 설정합니다.

TargetAppId

앱 알림 단추를 클릭할 때 시작할 앱의 PFN(패키지 패밀리 이름)을 가져오거나 설정합니다.

ToolTip

앱 알림 단추의 도구 설명 텍스트를 가져오거나 설정합니다.

메서드

AddArgument(String, String)

앱 알림 단추에 대한 XML 페이로드에 키/값 쌍으로 구성된 인수를 추가합니다.

IsButtonStyleSupported()

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

IsToolTipSupported()

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

SetButtonStyle(AppNotificationButtonStyle)

앱 알림 단추의 단추 스타일을 설정합니다.

SetContextMenuPlacement()

앱 알림 단추를 알림의 상황에 맞는 메뉴에 배치할 것을 요청합니다.

SetIcon(Uri)

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

SetInputId(String)

AppNotificationButton의 입력 ID를 설정합니다.

SetInvokeUri(Uri)

앱 알림 단추를 클릭할 때 시작되는 URI를 설정합니다.

SetInvokeUri(Uri, String)

명확성을 위해 제공된 PFN(패키지 패밀리 이름)을 사용하여 앱 알림 단추를 클릭할 때 시작되는 URI를 설정합니다.

SetToolTip(String)

앱 알림 단추의 도구 설명 텍스트를 설정합니다.

적용 대상