Grid 類別

定義

排列資料列和資料行中檢視的配置。

public ref class Grid : Microsoft::Maui::Controls::Layout, Microsoft::Maui::IGridLayout, System::Collections::Generic::ICollection<Microsoft::Maui::IView ^>, System::Collections::Generic::IEnumerable<Microsoft::Maui::IView ^>, System::Collections::Generic::IList<Microsoft::Maui::IView ^>
[Microsoft.Maui.Controls.ContentProperty("Children")]
public class Grid : Microsoft.Maui.Controls.Layout, Microsoft.Maui.IGridLayout, System.Collections.Generic.ICollection<Microsoft.Maui.IView>, System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>, System.Collections.Generic.IList<Microsoft.Maui.IView>
[<Microsoft.Maui.Controls.ContentProperty("Children")>]
type Grid = class
    inherit Layout
    interface IGridLayout
    interface ILayout
    interface IView
    interface IElement
    interface ITransform
    interface IContainer
    interface IList<IView>
    interface ICollection<IView>
    interface seq<IView>
    interface IEnumerable
    interface ISafeAreaView
    interface IPadding
[<Microsoft.Maui.Controls.ContentProperty("Children")>]
type Grid = class
    inherit Layout
    interface IGridLayout
    interface ILayout
    interface IView
    interface IElement
    interface ITransform
    interface IContainer
    interface IList<IView>
    interface ICollection<IView>
    interface seq<IView>
    interface IEnumerable
    interface ISafeAreaView
    interface IPadding
    interface ICrossPlatformLayout
Public Class Grid
Inherits Layout
Implements ICollection(Of IView), IEnumerable(Of IView), IGridLayout, IList(Of IView)
繼承
衍生
屬性
實作

備註

下列範例顯示基本用途:

using System;
using Microsoft.Maui.Controls;

namespace FormsGallery
{
    class GridDemoPage : ContentPage
    {
        public GridDemoPage()
        {
            Grid grid = new Grid
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                RowDefinitions = 
                {
                    new RowDefinition { Height = GridLength.Auto },
                    new RowDefinition { Height = GridLength.Auto },
                    new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },
                    new RowDefinition { Height = new GridLength(100, GridUnitType.Absolute) }
                },
                ColumnDefinitions = 
                {
                    new ColumnDefinition { Width = GridLength.Auto },
                    new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
                    new ColumnDefinition { Width = new GridLength(100, GridUnitType.Absolute) }
                }
            };

            grid.AddWithSpan(new Label
                {
                    Text = "Grid",
                    FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
                    HorizontalOptions = LayoutOptions.Center
                }, 0, 3, 0, 1);

            grid.Add(new Label
                {
                    Text = "Autosized cell",
                    TextColor = Color.White,
                    BackgroundColor = Color.Blue
                }, 0, 1);

            grid.Add(new BoxView
                {
                    Color = Color.Silver,
                    HeightRequest = 0
                }, 1, 1);

            grid.Add(new BoxView
                {
                    Color = Color.Teal
                }, 0, 2);

            grid.Add(new Label
                {
                    Text = "Leftover space",
                    TextColor = Color.Purple,
                    BackgroundColor = Color.Aqua,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment = TextAlignment.Center,
                }, 1, 2);

            grid.AddWithSpan(new Label
                {
                    Text = "Span two rows (or more if you want)",
                    TextColor = Color.Yellow,
                    BackgroundColor = Color.Navy,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment = TextAlignment.Center
                }, 2, 3, 1, 3);

            grid.AddWithSpan(new Label
                {
                    Text = "Span 2 columns",
                    TextColor = Color.Blue,
                    BackgroundColor = Color.Yellow,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment = TextAlignment.Center
                }, 0, 2, 3, 4);

            grid.Add(new Label
                {
                    Text = "Fixed 100x100",
                    TextColor = Color.Aqua,
                    BackgroundColor = Color.Red,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment = TextAlignment.Center
                }, 2, 3);

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            // Build the page.
            this.Content = grid;
        }
    }
}

以下顯示各種平臺上的 Grid:

配置類別可 Grid 方便儲存其每個子元素的數據列和數據行索引。 此外,使用方格配置元素時View,應用程式開發人員可以使用 、SetRow(BindableObject, Int32)GetRowSpan(BindableObject)SetRowSpan(BindableObject, Int32)靜態方法和數據行範圍的對等靜態方法,從子系本身GetRow(BindableObject)存取和變更子系的位置和範圍。

下列 Grid 成員方法的檔包含 XAML 語法範例:

建構函式

Grid()

排列資料列和資料行中檢視的配置。

欄位

_layoutManager

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
ColumnDefinitionsProperty

ColumnDefinitionsBindable 屬性。

ColumnProperty

附加屬性的 Bindable 屬性 Column

ColumnSpacingProperty

ColumnSpacingBindable 屬性。

ColumnSpanProperty

附加屬性的 Bindable 屬性 ColumnSpan

propertyMapper

表示檢視的內部 PropertyMapper

(繼承來源 View)
RowDefinitionsProperty

RowDefinitionsBindable 屬性。

RowProperty

附加屬性的 Bindable 屬性 Row

RowSpacingProperty

RowSpacingBindable 屬性。

RowSpanProperty

附加屬性的 Bindable 屬性 RowSpan

屬性

AnchorX

取得或設定相對於專案界限的任何轉換作業中心點的 X 元件。 這是可繫結屬性。

(繼承來源 VisualElement)
AnchorY

取得或設定相對於專案界限的任何轉換作業中心點的 Y 元件。 這是可繫結屬性。

(繼承來源 VisualElement)
AutomationId

取得或設定值,允許自動化架構尋找此項目並與之互動。

(繼承來源 Element)
Background

取得或設定 Brush 將用來填滿專案背景的 。 這是可繫結屬性。

(繼承來源 VisualElement)
BackgroundColor

取得或設定將 Color 填滿專案背景的 。 這是可繫結屬性。

(繼承來源 VisualElement)
Batched

取得值,這個值表示這個專案有批次變更。

(繼承來源 VisualElement)
Behaviors

取得與這個專案相關聯的物件清單 Behavior 。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
BindingContext

取得或設定 對象,這個物件包含屬於這個 BindableObject之系結屬性的目標屬性。 這是可繫結屬性。

(繼承來源 BindableObject)
Bounds

取得裝置獨立單位中元素的界限。

(繼承來源 VisualElement)
CascadeInputTransparent

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
Children

供 Microsoft.Maui.Controls 平台內部使用。

(繼承來源 Layout)
class

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
ClassId

取得或設定值,用來識別語意類似項目的集合。

(繼承來源 Element)
Clip

指定專案的裁剪區域。 這是可繫結屬性。

(繼承來源 VisualElement)
ColumnDefinitions

提供繫結屬性的介面,該介面取得或設定控制 Grid 中資料行配置的 ColumnDefinition 物件已排序集合。

ColumnSpacing

取得或設定 Grid 中數據行之間的空間量。 這是可繫結屬性。

Count

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
DesiredSize

取得這個項目在版面配置處理序的測量傳遞期間所計算的大小。

(繼承來源 VisualElement)
DisableLayout

取得值,這個值表示已停用這個專案的配置。

(繼承來源 VisualElement)
Dispatcher

取得建立這個可系結物件時可用的發送器,否則會嘗試尋找最接近的可用發送器, (可能是視窗/應用程式的) 。

(繼承來源 BindableObject)
EffectControlProvider

供 .NET MAUI 內部使用。

(繼承來源 Element)
Effects

取得或設定將在運行時間套用至項目的樣式和屬性。

(繼承來源 Element)
FlowDirection

取得或設定配置流程方向。 這是可繫結屬性。

(繼承來源 VisualElement)
Frame

取得或設定這個項目位於畫面上的框架。

(繼承來源 VisualElement)
GestureController

排列資料列和資料行中檢視的配置。

(繼承來源 View)
GestureRecognizers

與此檢視建立關聯的筆勢辨識器集合。

(繼承來源 View)
Handler

取得或設定 IViewHandler 與這個項目相關聯的 。

(繼承來源 VisualElement)
Height

取得此項目的目前呈現高度。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
HeightRequest

取得或設定此項目所需的高度覆寫項。 這是可繫結屬性。

(繼承來源 VisualElement)
HorizontalOptions

取得或設定 , LayoutOptions 定義元素在版面配置週期中的配置方式。 這是可繫結屬性。

(繼承來源 View)
Id

取得值,這個值可用來在應用程式執行期間唯一識別專案。

(繼承來源 Element)
IgnoreSafeArea

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
InputTransparent

取得或設定值,指出這個專案是否會在用戶互動期間響應點擊測試。 這是可繫結屬性。

(繼承來源 VisualElement)
IsClippedToBounds

取得或設定值,這個值決定 Layout 是否應該將其子系裁剪到其界限。

(繼承來源 Layout)
IsEnabled

取得或設定值,這個值指出使用者介面中是否已啟用此項目。 這是可繫結屬性。

(繼承來源 VisualElement)
IsEnabledCore

這個值代表累計 IsEnabled 值。 如果值將會變更,則覆寫這個屬性的所有類型也需要叫用 RefreshIsEnabledProperty () 方法。

(繼承來源 VisualElement)
IsFocused

取得值,這個值指出此項目目前是否為焦點。 這是可繫結屬性。

(繼承來源 VisualElement)
IsInPlatformLayout

取得或設定值,這個值表示這個專案目前正在執行平臺配置週期。

(繼承來源 VisualElement)
IsLoaded

指出專案是否連接到主物件樹狀結構。

(繼承來源 VisualElement)
IsPlatformEnabled

取得或設定值,這個值表示是否啟用這個項目的平臺對等專案。

(繼承來源 VisualElement)
IsPlatformStateConsistent

取得或設定值,這個值表示這個專案目前與平臺對等項目狀態一致。

(繼承來源 VisualElement)
IsReadOnly

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IsVisible

取得或設定值,這個值會決定此元素是否會在畫面上顯示,並佔用版面配置的空間。 這是可繫結屬性。

(繼承來源 VisualElement)
Item[Int32]

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
LogicalChildren
已淘汰.

供 Microsoft.Maui.Controls 平台內部使用。

(繼承來源 Element)
Margin

取得或設定檢視的邊界。

(繼承來源 View)
MaximumHeightRequest

取得或設定專案在版面配置期間要求的最大高度。 這是可繫結屬性。

(繼承來源 VisualElement)
MaximumWidthRequest

取得或設定專案在版面配置期間要求的最大寬度。 這是可繫結屬性。

(繼承來源 VisualElement)
MinimumHeightRequest

取得或設定元素在版面配置期間要求的最低高度。 這是可繫結屬性。

(繼承來源 VisualElement)
MinimumWidthRequest

取得或設定元素在版面配置期間要求的最低寬度。 這是可繫結屬性。

(繼承來源 VisualElement)
Navigation

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
NavigationProxy

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
Opacity

取得或設定套用至項目 (呈現時) 的不透明度值。 此值的範圍是 0 到 1;超出此範圍的值會設定為最接近的有效值。 這是可繫結屬性。

(繼承來源 VisualElement)
Padding

取得或設定 Layout 的內部填補。

(繼承來源 Layout)
Parent

取得或設定這個專案的父 Element 代。

(繼承來源 Element)
RealParent

供 .NET MAUI 內部使用。

(繼承來源 Element)
Resources

取得或設定本機資源字典。

(繼承來源 VisualElement)
Rotation

取得或設定呈現元素時繞著 Z 軸 (仿射旋轉) 的旋轉 (度)。 這是可繫結屬性。

(繼承來源 VisualElement)
RotationX

取得或設定呈現元素時繞著 X 軸 (透視旋轉) 的旋轉 (度)。 這是可繫結屬性。

(繼承來源 VisualElement)
RotationY

取得或設定呈現元素時繞著 Y 軸 (透視旋轉) 的旋轉 (度)。 這是可繫結屬性。

(繼承來源 VisualElement)
RowDefinitions

提供繫結屬性的介面,該介面取得或設定控制每個資料列高度的 RowDefinition 物件集合。

RowSpacing

取得或設定 Grid 中數據列之間的空間量。 這是可繫結屬性。

Scale

取得或設定套用至項目的縮放比例。 這是可繫結屬性。

(繼承來源 VisualElement)
ScaleX

取得或設定要套用至 X 方向的小數位數值。 這是可繫結屬性。

(繼承來源 VisualElement)
ScaleY

取得或設定要套用至 Y 方向的小數位數值。 這是可繫結屬性。

(繼承來源 VisualElement)
Shadow

取得或設定 元素所轉換的陰影效果。 這是可繫結屬性。

(繼承來源 VisualElement)
Style

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
StyleClass

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
StyleId

取得或設定使用者定義值來唯一識別項目。

(繼承來源 Element)
TranslationX

取得或設定項目的 X 轉譯差異。 這是可繫結屬性。

(繼承來源 VisualElement)
TranslationY

取得或設定項目的 Y 轉譯差異。 這是可繫結屬性。

(繼承來源 VisualElement)
Triggers

取得與這個專案相關聯的物件清單 TriggerBase 。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
VerticalOptions

取得或設定 , LayoutOptions 定義元素在版面配置週期中的配置方式。 這是可繫結屬性。

(繼承來源 View)
Visual

取得或設定會 IVisual 覆寫項目視覺外觀的實作。 這是可繫結屬性。

(繼承來源 VisualElement)
Width

取得這個專案的目前寬度。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
WidthRequest

取得或設定此項目所需的寬度覆寫項。 這是可繫結屬性。

(繼承來源 VisualElement)
Window

Window取得與項目相關聯的 。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
X

取得此項目的目前 X 位置。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
Y

取得此項目的目前 Y 位置。 這是唯讀的可繫結屬性。

(繼承來源 VisualElement)
ZIndex

取得或設定版面配置內元素的前端對后 Z 索引。 這是可繫結屬性。

(繼承來源 VisualElement)

方法

Add(IView)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
AddColumnDefinition(ColumnDefinition)

排列資料列和資料行中檢視的配置。

AddLogicalChild(Element)

Element將加入邏輯子系。

(繼承來源 Element)
AddRowDefinition(RowDefinition)

排列資料列和資料行中檢視的配置。

ApplyBindings()

將所有目前的系結套用至 BindingContext

(繼承來源 BindableObject)
Arrange(Rect)

放置子物件,並決定專案的大小。

(繼承來源 VisualElement)
ArrangeOverride(Rect)

允許子類別覆寫 Arrange(Rect) ,即使介面必須明確實作,以避免與舊 Arrange(Rect) 方法衝突。

(繼承來源 VisualElement)
BatchBegin()

表示項目屬性變更批次的開始。 如果變更更多屬性值,這可提升效能。

(繼承來源 VisualElement)
BatchCommit()

表示項目命令批次的結束,而且現在應該已認可這些命令。

(繼承來源 VisualElement)
ChangeVisualState()

排列資料列和資料行中檢視的配置。

(繼承來源 View)
Clear()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
ClearLogicalChildren()

拿掉所有子 Element系。

(繼承來源 Element)
ClearValue(BindableProperty)

清除先前為可系結屬性設定的任何值。

(繼承來源 BindableObject)
ClearValue(BindablePropertyKey)

清除先前針對可系結屬性設定的任何值,其索引鍵所識別。

(繼承來源 BindableObject)
CoerceValue(BindableProperty)

強制指定可系結屬性的值。 這是藉由叫用 BindableProperty.CoerceValueDelegate 指定的可系結屬性來完成。

(繼承來源 BindableObject)
CoerceValue(BindablePropertyKey)

強制指定可系結屬性的值。 這是藉由叫用 BindableProperty.CoerceValueDelegate 指定的可系結屬性來完成。

(繼承來源 BindableObject)
Contains(IView)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
CopyTo(IView[], Int32)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
CreateLayoutManager()

排列資料列和資料行中檢視的配置。

CrossPlatformArrange(Rect)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
CrossPlatformMeasure(Double, Double)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
EffectIsAttached(String)

供 .NET MAUI 內部使用。

(繼承來源 Element)
FindByName(String)

傳回具有指定名稱的元素。

(繼承來源 Element)
Focus()

嘗試將焦點設定至此項目。

(繼承來源 VisualElement)
GetChildElements(Point)

取得在指定 point之下可視化的子專案。

(繼承來源 View)
GetColumn(BindableObject)

取得 bindable 子項目的資料行。

GetColumn(IView)

排列資料列和資料行中檢視的配置。

GetColumnSpan(BindableObject)

取得 bindable 子項目的資料行範圍。

GetColumnSpan(IView)

排列資料列和資料行中檢視的配置。

GetEnumerator()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
GetRendererOverrides<T>()

排列資料列和資料行中檢視的配置。

(繼承來源 View)
GetRow(BindableObject)

取得 bindable 子項目的資料列。

GetRow(IView)

排列資料列和資料行中檢視的配置。

GetRowSpan(BindableObject)

取得 bindable 子項目的資料列範圍。

GetRowSpan(IView)

排列資料列和資料行中檢視的配置。

GetValue(BindableProperty)

傳回包含在指定可系結屬性中的值。

(繼承來源 BindableObject)
IndexOf(IView)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
Insert(Int32, IView)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
InsertLogicalChild(Int32, Element)

Element 插入至位於指定索引處的邏輯子系。

(繼承來源 Element)
InvalidateMeasure()

排列資料列和資料行中檢視的配置。

InvalidateMeasureNonVirtual(InvalidationTrigger)

使專案的量值失效。

(繼承來源 VisualElement)
InvalidateMeasureOverride()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IsSet(BindableProperty)

判斷可系結屬性是否存在,且已設定值。

(繼承來源 BindableObject)
Layout(Rect)

在配置週期期間更新項目的界限。

(繼承來源 VisualElement)
Measure(Double, Double, MeasureFlags)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
MeasureOverride(Double, Double)

提供允許子類別覆寫 Measure(Double, Double, MeasureFlags) 的方式,即使介面必須明確實作,以避免與舊的 Measure 方法衝突。

(繼承來源 VisualElement)
OnAdd(Int32, IView)

排列資料列和資料行中檢視的配置。

OnBindingContextChanged()

排列資料列和資料行中檢視的配置。

OnChildAdded(Element)

排列資料列和資料行中檢視的配置。

(繼承來源 VisualElement)
OnChildRemoved(Element, Int32)

排列資料列和資料行中檢視的配置。

(繼承來源 VisualElement)
OnChildrenReordered()

引發 ChildrenReordered 事件。

(繼承來源 VisualElement)
OnClear()

排列資料列和資料行中檢視的配置。

OnHandlerChanged()

在衍生類別中覆寫時,應該引發 HandlerChanged 事件。

(繼承來源 Element)
OnHandlerChanging(HandlerChangingEventArgs)

在衍生類別中覆寫時,應該引發 HandlerChanging 事件。

(繼承來源 Element)
OnInsert(Int32, IView)

排列資料列和資料行中檢視的配置。

OnMeasure(Double, Double)

配置度量發生時所呼叫的方法。

(繼承來源 VisualElement)
OnParentChanged()

在衍生類別中覆寫時,應該引發 ParentChanged 事件。

(繼承來源 Element)
OnParentChanging(ParentChangingEventArgs)

在衍生類別中覆寫時,應該引發 ParentChanging 事件。

(繼承來源 Element)
OnParentSet()

排列資料列和資料行中檢視的配置。

(繼承來源 NavigableElement)
OnPropertyChanged(String)

繫結屬性變更時呼叫的方法。

(繼承來源 Element)
OnPropertyChanging(String)

引發 PropertyChanging 事件。

(繼承來源 BindableObject)
OnRemove(Int32, IView)

排列資料列和資料行中檢視的配置。

OnSizeAllocated(Double, Double)

在版面配置週期期間設定項目大小時所呼叫的方法。 實作這個方法可為此事件加入類別處理。

(繼承來源 VisualElement)
OnUpdate(Int32, IView, IView)

排列資料列和資料行中檢視的配置。

PlatformSizeChanged()

訊號指出此元素大小的平臺對等專案已變更,而且可能需要新的版面配置週期。

(繼承來源 VisualElement)
RefreshIsEnabledProperty()

如果發生某些事件,而且屬性的值將會變更, IsEnabledCore 則必須一律呼叫這個方法。

(繼承來源 VisualElement)
Remove(IView)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
RemoveAt(Int32)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
RemoveBinding(BindableProperty)

從可系結屬性中移除先前設定的系結。

(繼承來源 BindableObject)
RemoveDynamicResource(BindableProperty)

拿掉先前設定的動態資源。

(繼承來源 Element)
RemoveLogicalChild(Element)

從邏輯子系中移除第一個出現的特定 Element 專案。

(繼承來源 Element)
SetBinding(BindableProperty, BindingBase)

將系結指派給可系結屬性。

(繼承來源 BindableObject)
SetColumn(BindableObject, Int32)

變更將在其中放置子項目的資料行。

SetColumn(IView, Int32)

排列資料列和資料行中檢視的配置。

SetColumnSpan(BindableObject, Int32)

變更指定子項目的資料行範圍。

SetColumnSpan(IView, Int32)

排列資料列和資料行中檢視的配置。

SetDynamicResource(BindableProperty, String)

使用提供的索引鍵, BindableProperty 設定要透過 DynamicResource 更新這個項目的 屬性。

(繼承來源 Element)
SetRow(BindableObject, Int32)

變更將在其中放置子項目的資料列。

SetRow(IView, Int32)

排列資料列和資料行中檢視的配置。

SetRowSpan(BindableObject, Int32)

變更指定子項目的資料列範圍。

SetRowSpan(IView, Int32)

排列資料列和資料行中檢視的配置。

SetValue(BindableProperty, Object)

設定指定可系結屬性的值。

(繼承來源 BindableObject)
SetValue(BindablePropertyKey, Object)

設定指定可系結屬性的值。

(繼承來源 BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

供 Microsoft.Maui.Controls 平台內部使用。

(繼承來源 BindableObject)
SetValueFromRenderer(BindableProperty, Object)

供 .NET MAUI 內部使用。

(繼承來源 Element)
SetValueFromRenderer(BindablePropertyKey, Object)

供 .NET MAUI 內部使用。

(繼承來源 Element)
SizeAllocated(Double, Double)

在版面配置週期期間呼叫的方法,以發出子樹狀結構配置開頭的訊號。

(繼承來源 VisualElement)
UnapplyBindings()

從目前內容中移除所有目前的系結。

(繼承來源 BindableObject)
Unfocus()

取消設定此元素上的鍵盤焦點。

(繼承來源 VisualElement)

事件

BatchCommitted

呼叫 來認可 BatchCommit()屬性變更批次時發生。

(繼承來源 VisualElement)
BindingContextChanged

發生於 BindingContext 屬性的值變更時。

(繼承來源 BindableObject)
ChildAdded

每當子專案加入至 項目時引發。

(繼承來源 Element)
ChildRemoved

每當從專案中移除子項目時引發。

(繼承來源 Element)
ChildrenReordered

發生於這個專案的子系順序變更時。

(繼承來源 VisualElement)
DescendantAdded

每當子專案加入至專案的子樹時引發。

(繼承來源 Element)
DescendantRemoved

每當從專案子樹中移除子項目時引發。

(繼承來源 Element)
FocusChangeRequested
已淘汰.

排列資料列和資料行中檢視的配置。

(繼承來源 VisualElement)
Focused

發生於這個元素聚焦時。

(繼承來源 VisualElement)
HandlerChanged

每當項目的處理程式變更時引發。

(繼承來源 Element)
HandlerChanging

每當項目的處理程序開始變更時引發。

(繼承來源 Element)
Loaded

發生於專案已建構並加入至物件樹狀結構時。

(繼承來源 VisualElement)
MeasureInvalidated

發生於專案的目前量值已失效時。

(繼承來源 VisualElement)
ParentChanged

每當專案的父代變更時引發。

(繼承來源 Element)
ParentChanging

每當項目的 開始變更時引發。

(繼承來源 Element)
PropertyChanged

當屬性值變更時發生。

(繼承來源 BindableObject)
PropertyChanging

當屬性值變更中時發生。

(繼承來源 BindableObject)
SizeChanged

發生於專案的大小變更時。

(繼承來源 VisualElement)
Unfocused

發生於這個專案未聚焦時。

(繼承來源 VisualElement)
Unloaded

當專案不再連接到主要物件樹狀結構時發生。

(繼承來源 VisualElement)

明確介面實作

IBindableLayout.Children

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IContextFlyoutElement.ContextFlyout

ContextFlyout取得檢視的 。 功能表飛出視窗、功能表飛出視窗子專案,以及功能表飛出視窗分隔符可以新增至內容飛出視窗。

(繼承來源 Element)
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

排列資料列和資料行中檢視的配置。

(繼承來源 BindableObject)
IEffectControlProvider.RegisterEffect(Effect)

排列資料列和資料行中檢視的配置。

(繼承來源 Element)
IElement.Handler

取得或設定 Element 的 View Handler。

(繼承來源 VisualElement)
IElement.Parent

取得專案的父代。

(繼承來源 Element)
IElementController.Descendants()

供 .NET MAUI 內部使用。

(繼承來源 Element)
IElementController.LogicalChildren

供 .NET MAUI 內部使用。

(繼承來源 Element)
IElementController.SetValueFromRenderer(BindableProperty, Object)

供 .NET MAUI 內部使用。

(繼承來源 Element)
IEnumerable.GetEnumerator()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IGestureController.CompositeGestureRecognizers

排列資料列和資料行中檢視的配置。

(繼承來源 View)
IGridLayout.ColumnDefinitions

排列資料列和資料行中檢視的配置。

IGridLayout.RowDefinitions

排列資料列和資料行中檢視的配置。

IHotReloadableView.Reload()

排列資料列和資料行中檢視的配置。

(繼承來源 View)
IHotReloadableView.ReloadHandler

排列資料列和資料行中檢視的配置。

(繼承來源 View)
IHotReloadableView.TransferState(IView)

排列資料列和資料行中檢視的配置。

(繼承來源 View)
ILayout.ClipsToBounds

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
INameScope.RegisterName(String, Object)

供 .NET MAUI 內部使用。

(繼承來源 Element)
INameScope.UnregisterName(String)

供 .NET MAUI 內部使用。

(繼承來源 Element)
IPaddingElement.OnPaddingPropertyChanged(Thickness, Thickness)

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IPaddingElement.PaddingDefaultValueCreator()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IPropertyMapperView.GetPropertyMapperOverrides()

排列資料列和資料行中檢視的配置。

(繼承來源 View)
IReplaceableView.ReplacedView

排列資料列和資料行中檢視的配置。

(繼承來源 View)
IToolTipElement.ToolTip

代表小型矩形彈出視窗,當使用者將指標放在檢視上時,顯示檢視用途的簡短描述。

(繼承來源 Element)
IView.Arrange(Rect)

放置子專案,並決定元素的大小。

(繼承來源 VisualElement)
IView.Background

取得將填滿檢視背景的繪製。

(繼承來源 VisualElement)
IView.Clip

取得用來定義檢視內容的大綱的路徑。

(繼承來源 VisualElement)
IView.FlowDirection

眼睛掃描UI元素的方向

(繼承來源 VisualElement)
IView.Height

取得 IView 的指定高度。

(繼承來源 VisualElement)
IView.HorizontalLayoutAlignment

決定此元素在容器中排列的水平層面

(繼承來源 View)
IView.InvalidateArrange()

呼叫以使這個檢視的配置失效的方法。

(繼承來源 VisualElement)
IView.InvalidateMeasure()

訊號指出此檢視的目前量值已不再有效,而且必須在下一個量值階段重新計算。

(繼承來源 VisualElement)
IView.IsFocused

取得值,指出此檢視目前是否為焦點。

(繼承來源 VisualElement)
IView.Margin

Margin 代表檢視與其相鄰檢視之間的距離。

(繼承來源 View)
IView.MaximumHeight

取得 IView 的指定最大高度條件約束,介於零到雙精度浮點之間。正無限大。

(繼承來源 VisualElement)
IView.MaximumWidth

取得 IView 的指定最大寬度條件約束,介於零到雙精度浮點之間。正無限大。

(繼承來源 VisualElement)
IView.Measure(Double, Double)

匯報 檢視的大小。

(繼承來源 VisualElement)
IView.MinimumHeight

取得 IView 的指定最小高度條件約束,介於零到雙精度浮點之間。正無限大。

(繼承來源 VisualElement)
IView.MinimumWidth

取得 IView 的指定最小寬度條件約束,介於零到雙精度浮點之間。正無限大。

(繼承來源 VisualElement)
IView.Semantics

將語意新增至每個檢視以取得輔助功能

(繼承來源 VisualElement)
IView.Shadow

在目標檢視周圍繪製陰影。

(繼承來源 VisualElement)
IView.VerticalLayoutAlignment

決定此元素在容器中排列的垂直層面

(繼承來源 View)
IView.Visibility

取得值,這個值會判斷這個檢視是否應該是可視化樹狀結構的一部分。

(繼承來源 VisualElement)
IView.Width

取得 IView 的指定寬度。

(繼承來源 VisualElement)
IVisualElementController.EffectiveFlowDirection

供 .NET MAUI 內部使用。

(繼承來源 VisualElement)
IVisualElementController.InvalidateMeasure(InvalidationTrigger)

供 .NET MAUI 內部使用。

(繼承來源 VisualElement)
IVisualTreeElement.GetVisualChildren()

排列資料列和資料行中檢視的配置。

(繼承來源 Layout)
IVisualTreeElement.GetVisualParent()

取得專案的可視化父代。

(繼承來源 Element)

擴充方法

AbortAnimation(IAnimatable, String)

停止動畫。

Animate(IAnimatable, String, Animation, UInt32, UInt32, Easing, Action<Double,Boolean>, Func<Boolean>)

設定指定參數並開始動畫。

Animate(IAnimatable, String, Action<Double>, Double, Double, UInt32, UInt32, Easing, Action<Double,Boolean>, Func<Boolean>)

設定指定參數並開始動畫。

Animate(IAnimatable, String, Action<Double>, UInt32, UInt32, Easing, Action<Double,Boolean>, Func<Boolean>)

設定指定參數並開始動畫。

Animate<T>(IAnimatable, String, Func<Double,T>, Action<T>, UInt32, UInt32, Easing, Action<T,Boolean>, Func<Boolean>, IAnimationManager)

設定指定參數並開始動畫。

AnimateKinetic(IAnimatable, String, Func<Double,Double,Boolean>, Double, Double, Action, IAnimationManager)

設定指定參數並開始動態動畫。

AnimationIsRunning(IAnimatable, String)

傳回布林值,指出由 handle 指定的動畫是否正在執行中。

Batch(IAnimatable)

排列資料列和資料行中檢視的配置。

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

排列資料列和資料行中檢視的配置。

SetAppTheme<T>(BindableObject, BindableProperty, T, T)

排列資料列和資料行中檢視的配置。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

排列資料列和資料行中檢視的配置。

SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

建立並將繫結套用至屬性。

Add(Grid, IView, Int32, Int32)

IView將 加入至Grid位於指定之數據行和數據列的 ,其數據列範圍為 1,且數據行範圍為 1。

Add(Grid, IView, Int32, Int32, Int32, Int32)
已淘汰.

IView將加入至Grid位於指定的資料列和資料列範圍的 。

AddWithSpan(Grid, IView, Int32, Int32, Int32, Int32)

IView將 加入至Grid位於指定之數據列和數據行的 ,其中包含指定的數據列和數據行範圍。

FindByName<T>(Element, String)

排列資料列和資料行中檢視的配置。

CancelAnimations(VisualElement)

中止專案上的所有動畫 (例如LayoutToTranslateToScaleTo等等 ) view

FadeTo(VisualElement, Double, UInt32, Easing)

傳回僅根據 opacitylengtheasing 參數描述的內容執行淡化的工作。

LayoutTo(VisualElement, Rect, UInt32, Easing) 傳回工作,可VisualElement簡化 由 參數所指定viewbounds之矩形的 界限。
RelRotateTo(VisualElement, Double, UInt32, Easing)

view 所指定的 VisualElement,從其目前的旋轉,加以旋轉 drotation

RelScaleTo(VisualElement, Double, UInt32, Easing)

傳回將 view 所指定 VisualElement 從其目前大小縮放至 dscale 的工作。

RotateTo(VisualElement, Double, UInt32, Easing)

傳回工作,此工作會輪替 、 和 easing 參數所lengthrotation描述的 所指定的 viewVisualElement

RotateXTo(VisualElement, Double, UInt32, Easing)

傳回工作,該工作會扭曲 所viewrotation指定 之的 VisualElement X 軸,並花費時間length並使用 easing

RotateYTo(VisualElement, Double, UInt32, Easing)

傳回會扭曲 指定viewrotationVisualElement 的 Y 軸的工作,其花費時間length並使用 easing

ScaleTo(VisualElement, Double, UInt32, Easing)

傳回將 view 所指定 VisualElement 縮放至絕對縮放比例 scale 的工作。

ScaleXTo(VisualElement, Double, UInt32, Easing)

傳回將 所view指定 之 X VisualElement 軸調整為絕對刻度因數 scale的工作。

ScaleYTo(VisualElement, Double, UInt32, Easing)

傳回將 所view指定 之 VisualElement 的 Y 軸調整為絕對刻度因數 scale的工作。

TranslateTo(VisualElement, Double, Double, UInt32, Easing)

將專案 TranslationXTranslationY 屬性從其目前值動畫顯示到新的值。 這可確保輸入配置在與視覺效果配置相同的位置。

HasVisualStateGroups(VisualElement)

如果 element 具有一或多個與其建立關聯的視覺狀態群組,則傳回 true。 否則傳回 false

CheckHandlers(IView)

排列資料列和資料行中檢視的配置。

ComputeDesiredSize(IView, Double, Double)

排列資料列和資料行中檢視的配置。

ComputeFrame(IView, Rect)

排列資料列和資料行中檢視的配置。

ToHandler(IElement, IMauiContext)

排列資料列和資料行中檢視的配置。

ToPlatform(IElement, IMauiContext)

排列資料列和資料行中檢視的配置。

ToHandler(IView, IMauiContext)

排列資料列和資料行中檢視的配置。

SetSemanticFocus(IView)

排列資料列和資料行中檢視的配置。

CaptureAsync(IView)

排列資料列和資料行中檢視的配置。

GetVisualElementWindow(IVisualTreeElement)

如果元素包含在其中,則取得包含可視化樹狀結構項目的視窗。

GetVisualTreeDescendants(IVisualTreeElement)

取得子系的整個階層,做為指定可視化樹狀結構元素的子系列表。

GetVisualTreeElements(IVisualTreeElement, Point)

根據指定的Point,取得可視化樹狀結構專案的子系列表。

GetVisualTreeElements(IVisualTreeElement, Rect)

根據矩形取得可視化樹狀結構元素子系的清單。

GetVisualTreeElements(IVisualTreeElement, Double, Double)

根據指定的 x、y 點,取得可視化樹狀結構元素子系的清單。

GetVisualTreeElements(IVisualTreeElement, Double, Double, Double, Double)

根據其座標所定義的矩形,取得可視化樹狀結構元素子系的清單,該矩形是以平台單位指定,而不是圖元。

適用於