MenuBarItemAutomationPeer 類別

定義

MenuBarItem類型公開給Microsoft 消費者介面自動化

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

/// [Microsoft.UI.Xaml.MUXContractProperty(version=7)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=7)]
class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
[Microsoft.UI.Xaml.MUXContractProperty(version=7)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=7)]
public class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public class MenuBarItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider
Public Class MenuBarItemAutomationPeer
Inherits FrameworkElementAutomationPeer
Implements IExpandCollapseProvider, IInvokeProvider
繼承
MenuBarItemAutomationPeer
屬性
Microsoft.UI.Xaml.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute ContractVersionAttribute
實作

範例

提示

WinUI 3 資源庫WinUI 2 資源庫應用程式包含大部分 WinUI 3 和 WinUI 2 控制項、特性和功能的互動式範例。

如果已安裝,請按一下下列連結加以開啟: WinUI 3 資源庫WinUI 2 資源庫

如果未安裝,您可以從 Microsoft Store 下載 WinUI 3 資源庫WinUI 2 資源庫

您也可以從 GitHub 取得的原始程式碼 (使用 WinUI 3 的主要 分支和 WinUI 2) 的 winui2 分支。

建構函式

MenuBarItemAutomationPeer(MenuBarItem)

初始化 MenuBarItemAutomationPeer 類別的新實例。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

屬性

ExpandCollapseState

取得 MenuBarItem的狀態展開或折迭。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

方法

Collapse()

隱藏 MenuBarItem子系的所有節點、控制項或內容。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

Expand()

顯示 MenuBarItem的所有子節點、控制項或內容。

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

Invoke()

傳送要求,以按一下與自動化對等相關聯的 MenuBarItem

本檔適用于 Windows 應用程式 SDK 中適用于 WinUI 的 WinUI 2 for UWP (,請參閱Windows 應用程式 SDK命名空間) 。

適用於

另請參閱