AppNotificationBuilder.AddComboBox(AppNotificationComboBox) 方法

定義

將下拉式方塊新增至代理程式更新的 XML 承載。

public:
 virtual AppNotificationBuilder ^ AddComboBox(AppNotificationComboBox ^ value) = AddComboBox;
AppNotificationBuilder AddComboBox(AppNotificationComboBox const& value);
public AppNotificationBuilder AddComboBox(AppNotificationComboBox value);
function addComboBox(value)
Public Function AddComboBox (value As AppNotificationComboBox) As AppNotificationBuilder

參數

value
AppNotificationComboBox

AppNotificationComboBox物件,代表要新增至通知的下拉式方塊。

傳回

傳回 AppNotificationBuilder 實例,以便鏈結其他方法呼叫。

範例

下列範例示範如何將下拉式方塊新增至代理程式更新。

var notification = new AppNotificationBuilder()
    .AddText("Can you attend?")
    .AddComboBox(new AppNotificationComboBox("ComboBox")
        .AddItem("yes", "Going")
        .AddItem("maybe", "Maybe")
        .AddItem("no", "Decline")
        .SetSelectedItem("yes"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

產生的 XML 承載:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Can you attend?</text>
        </binding>
    </visual>
    <actions>
        <input id='ComboBox' type='selection' defaultInput='yes'>
            <selection id='maybe' content='Maybe'/><selection id='no' content='Decline'/>
            <selection id='yes' content='Going'/>
        </input>
    </actions>
</toast>

備註

最多可以新增五個輸入控制項至單一通知。

如需使用 AppNotificationBuilder API 建立代理程式更新 UI 的指引,請參閱 代理程式更新內容

如需代理程式更新之 XML 架構的參考資訊,請參閱 代理程式更新內容架構

適用於