MenuItem 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
呈現功能表項目並將其與命令建立關聯的類別。
public class MenuItem : Xamarin.Forms.BaseMenuItem, Xamarin.Forms.IMenuItemController
type MenuItem = class
inherit BaseMenuItem
interface IMenuItemController
- 繼承
- 衍生
- 實作
建構函式
| MenuItem() |
初始化新的 MenuItem 執行個體。 |
欄位
| AcceleratorProperty |
加速器附加屬性的備份存放區。 |
| CommandParameterProperty |
識別命令參數繫結屬性。 |
| CommandProperty |
識別命令繫結屬性。 |
| IconImageSourceProperty |
呈現功能表項目並將其與命令建立關聯的類別。 |
| IconProperty |
已淘汰.
識別圖示繫結屬性。 |
| IsDestructiveProperty |
識別 IsDestructive 繫結屬性。 |
| IsEnabledProperty |
供 Xamarin.Forms 平台內部使用。 |
| TextProperty |
識別文字繫結屬性。 |
屬性
| AutomationId |
取得或設定值,允許自動化架構尋找此項目並與之互動。 (繼承來源 Element) |
| BindingContext |
取得或設定物件,這個物件包含屬於此 BindableObject 屬性繫結屬性將設為目標的屬性。 (繼承來源 BindableObject) |
| class |
呈現功能表項目並將其與命令建立關聯的類別。 |
| ClassId |
取得或設定值,用來識別語意類似項目的集合。 (繼承來源 Element) |
| Command |
取得或設定當按一下功能表時所執行的命令。 |
| CommandParameter |
取得或設定傳遞至命令的參數。 |
| Dispatcher |
呈現功能表項目並將其與命令建立關聯的類別。 (繼承來源 BindableObject) |
| EffectControlProvider |
供 Xamarin.Forms 平台內部使用。 (繼承來源 Element) |
| Effects |
套用至此項目的效果清單。 (繼承來源 Element) |
| Icon |
已淘汰.
取得或設定功能表的圖示。 |
| IconImageSource |
呈現功能表項目並將其與命令建立關聯的類別。 |
| Id |
取得值,可用來在應用程式執行期間唯一識別項目。 (繼承來源 Element) |
| IsDestructive |
取得或設定值,此值指出功能表項目是否會移除相關聯的 UI 項目。 |
| IsEnabled |
供 Xamarin.Forms 平台內部使用。 |
| IsEnabledPropertyName |
已淘汰.
呈現功能表項目並將其與命令建立關聯的類別。 |
| LogicalChildren |
供 Xamarin.Forms 平台內部使用。 (繼承來源 Element) |
| Parent |
取得或設定項目的父項目。 (繼承來源 Element) |
| ParentView |
已淘汰.
取得即此項目最接近上階的項目,而此項目是 VisualElement。 (繼承來源 Element) |
| Platform |
已淘汰.
呈現功能表項目並將其與命令建立關聯的類別。 (繼承來源 Element) |
| RealParent |
供 Xamarin.Forms 平台內部使用。 (繼承來源 Element) |
| StyleClass |
設定搭配 Shell 使用時,所產生之 FlyoutItem 的 StyleClass |
| StyleId |
取得或設定使用者定義值來唯一識別項目。 (繼承來源 Element) |
| Text |
功能表項目的文字。 |
方法
事件
| BindingContextChanged |
每當 BindingContext 屬性變更時引發。 (繼承來源 BindableObject) |
| ChildAdded |
只要將子項目新增至項目時就發生。 (繼承來源 Element) |
| ChildRemoved |
只要從項目移除子項目時就發生。 (繼承來源 Element) |
| Clicked |
按一下功能表項目時所引發的事件。 |
| DescendantAdded |
只要將子項目新增至項目樹狀子目錄時即發生。 (繼承來源 Element) |
| DescendantRemoved |
只要從項目樹狀子目錄移除子項目時即發生。 (繼承來源 Element) |
| PlatformSet |
已淘汰.
呈現功能表項目並將其與命令建立關聯的類別。 (繼承來源 Element) |
| PropertyChanged |
在屬性變更時引發。 (繼承來源 BindableObject) |
| PropertyChanging |
在屬性即將變更時引發。 (繼承來源 BindableObject) |
明確介面實作
| IDynamicResourceHandler.SetDynamicResource(BindableProperty, String) |
供 Xamarin.Forms 平台內部使用。 (繼承來源 BindableObject) |
| IElementController.SetValueFromRenderer(BindableProperty, Object) |
供 Xamarin.Forms 平台內部使用。 (繼承來源 Element) |
| IMenuItemController.Activate() |
呈現功能表項目並將其與命令建立關聯的類別。 |
| INameScope.RegisterName(String, Object) |
僅供內部使用。 (繼承來源 Element) |
擴充方法
| GetPropertyIfSet<T>(BindableObject, BindableProperty, T) |
呈現功能表項目並將其與命令建立關聯的類別。 |
| SetAppThemeColor(BindableObject, BindableProperty, Color, Color) |
呈現功能表項目並將其與命令建立關聯的類別。 |
| SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String) |
建立並將繫結套用至屬性。 |
| SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String) |
已淘汰.
從運算式建立及套用繫結。 |
| SetOnAppTheme<T>(BindableObject, BindableProperty, T, T) |
呈現功能表項目並將其與命令建立關聯的類別。 |
| FindByName<T>(Element, String) |
傳回包含 |