MenuItem 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
呈現功能表項目並將其與命令建立關聯的類別。
public ref class MenuItem : Microsoft::Maui::Controls::BaseMenuItem, Microsoft::Maui::Controls::IMenuItemController, Microsoft::Maui::IMenuElement
public class MenuItem : Microsoft.Maui.Controls.BaseMenuItem, Microsoft.Maui.Controls.IMenuItemController, Microsoft.Maui.IMenuElement
type MenuItem = class
inherit BaseMenuItem
interface IMenuElement
interface IElement
interface IImageSourcePart
interface IText
interface ITextStyle
interface IMenuItemController
type MenuItem = class
inherit BaseMenuItem
interface IMenuItemController
interface IMenuElement
interface IElement
interface IImageSourcePart
interface IText
interface ITextStyle
Public Class MenuItem
Inherits BaseMenuItem
Implements IMenuElement, IMenuItemController
- 繼承
- 衍生
- 實作
建構函式
MenuItem() |
初始化新的 MenuItem 執行個體。 |
欄位
AcceleratorProperty |
已淘汰.
的 Accelerator可系結屬性。 |
CommandParameterProperty |
的 CommandParameter可系結屬性。 |
CommandProperty |
的 Command可系結屬性。 |
IconImageSourceProperty |
的 IconImageSource可系結屬性。 |
IsDestructiveProperty |
的 IsDestructive可系結屬性。 |
IsEnabledProperty |
的 IsEnabled可系結屬性。 |
TextProperty |
的 Text可系結屬性。 |
屬性
AutomationId |
取得或設定值,允許自動化架構尋找此項目並與之互動。 (繼承來源 Element) |
BindingContext |
取得或設定 對象,這個物件包含系結屬性所屬之系結屬性的目標屬性 BindableObject。 這是可繫結屬性。 (繼承來源 BindableObject) |
class |
呈現功能表項目並將其與命令建立關聯的類別。 |
ClassId |
取得或設定值,用來識別語意類似項目的集合。 (繼承來源 Element) |
Command |
取得或設定當按一下功能表時所執行的命令。 |
CommandParameter |
取得或設定傳遞至命令的參數。 |
Dispatcher |
取得建立這個可系結物件時可用的發送器,否則會嘗試尋找最接近的可用發送器, (可能是視窗/應用程式的) 。 (繼承來源 BindableObject) |
EffectControlProvider |
供 .NET MAUI 內部使用。 (繼承來源 Element) |
Effects |
取得或設定將在運行時間套用至 元素的樣式和屬性。 (繼承來源 Element) |
Handler |
取得或設定這個項目的相關聯處理程式。 (繼承來源 Element) |
IconImageSource |
呈現功能表項目並將其與命令建立關聯的類別。 |
Id |
取得值,這個值可用來在應用程式執行期間唯一識別專案。 (繼承來源 Element) |
IsDestructive |
取得或設定值,此值指出功能表項目是否會移除相關聯的 UI 項目。 |
IsEnabled |
供 Microsoft.Maui.Controls 平台內部使用。 |
LogicalChildren |
已淘汰.
供 Microsoft.Maui.Controls 平台內部使用。 (繼承來源 Element) |
Parent |
取得或設定這個專案的父代 Element 。 (繼承來源 Element) |
RealParent |
供 .NET MAUI 內部使用。 (繼承來源 Element) |
StyleClass |
設定搭配 Shell 使用時,所產生之 FlyoutItem 的 StyleClass |
StyleId |
取得或設定使用者定義值來唯一識別項目。 (繼承來源 Element) |
Text |
功能表項目的文字。 |
方法
事件
BindingContextChanged |
發生於 BindingContext 屬性的值變更時。 (繼承來源 BindableObject) |
ChildAdded |
每當子專案加入至 元素時引發。 (繼承來源 Element) |
ChildRemoved |
每當從專案中移除子項目時引發。 (繼承來源 Element) |
Clicked |
呈現功能表項目並將其與命令建立關聯的類別。 |
DescendantAdded |
每當子專案加入至專案的子樹時引發。 (繼承來源 Element) |
DescendantRemoved |
每當從專案子樹中移除子項目時引發。 (繼承來源 Element) |
HandlerChanged |
每當項目的處理程式變更時引發。 (繼承來源 Element) |
HandlerChanging |
每當項目的處理程序開始變更時引發。 (繼承來源 Element) |
ParentChanged |
每當專案的父代變更時引發。 (繼承來源 Element) |
ParentChanging |
每當項目的 開始變更時引發。 (繼承來源 Element) |
PropertyChanged |
當屬性值變更時發生。 (繼承來源 BindableObject) |
PropertyChanging |
當屬性值變更中時發生。 (繼承來源 BindableObject) |
明確介面實作
擴充方法
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應