다음을 통해 공유


AppNotificationComboBox 클래스

정의

앱 알림에 표시되는 콤보 상자를 나타냅니다.

public ref class AppNotificationComboBox sealed
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.AppNotifications.Builder.IAppNotificationComboBoxFactory, 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 AppNotificationComboBox final
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.AppNotifications.Builder.IAppNotificationComboBoxFactory), 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 AppNotificationComboBox
function AppNotificationComboBox(id)
Public NotInheritable Class AppNotificationComboBox
상속
Object Platform::Object IInspectable AppNotificationComboBox
특성

예제

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

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddComboBox(new AppNotificationComboBox("combobox_id")
        .SetTitle("Select an item:")
        .AddItem("id_one", "Item one")
        .AddItem("id_two", "Item two")
        .SetSelectedItem("id_one"))
    .BuildNotification();


AppNotificationManager.Default.Show(notification);

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

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <input id='combobox_id' type='selection' title='Select an item:' defaultInput='id_one'>
            <selection id='id_one' content='Item one'/>
            <selection id='id_two' content='Item two'/>
        </input>
    </actions>
</toast>

설명

AppNotificationBuilder.AddComboBox를 호출하여 앱 알림의 XML 페이로드에 콤보 상자를 추가합니다. 단일 앱 알림에 최대 5개의 입력을 추가할 수 있습니다.

생성자

AppNotificationComboBox(String)

지정된 ID를 사용하여 AppNotificationComboBox 클래스의 새 instance 초기화합니다.

속성

Items

AppNotificationComboBox의 항목을 가져오거나 설정합니다.

SelectedItem

앱 알림 콤보 상자에 대해 선택한 항목을 가져오거나 설정합니다.

Title

앱 알림 콤보 상자의 제목을 가져오거나 설정합니다.

메서드

AddItem(String, String)

AppNotificationComboBox에 항목을 추가합니다.

SetSelectedItem(String)

앱 알림 콤보 상자에 대해 선택한 항목을 설정합니다.

SetTitle(String)

앱 알림 콤보 상자의 제목을 설정합니다.

적용 대상