共用方式為


PlatformBehavior<TView,TPlatformView> 類別

定義

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

generic <typename TView, typename TPlatformView>
 where TView : Element where TPlatformView : classpublic ref class PlatformBehavior abstract : Microsoft::Maui::Controls::Behavior<TView>
public abstract class PlatformBehavior<TView,TPlatformView> : Microsoft.Maui.Controls.Behavior<TView> where TView : Element where TPlatformView : class
type PlatformBehavior<'View, 'PlatformView (requires 'View :> Element and 'PlatformView : null)> = class
    inherit Behavior<'View (requires 'View :> Element)>
Public MustInherit Class PlatformBehavior(Of TView, TPlatformView)
Inherits Behavior(Of TView)

類型參數

TView

虛擬檢視

TPlatformView

平台檢視

繼承
Behavior<TView>
PlatformBehavior<TView,TPlatformView>
衍生

建構函式

PlatformBehavior<TView,TPlatformView>()

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

屬性

AssociatedType

取得可與這個 Behavior 建立關聯的物件類型。

(繼承來源 Behavior)
BindingContext

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

(繼承來源 BindableObject)
Dispatcher

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

(繼承來源 BindableObject)

方法

ApplyBindings()

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

(繼承來源 BindableObject)
ClearValue(BindableProperty)

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

(繼承來源 BindableObject)
ClearValue(BindablePropertyKey)

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

(繼承來源 BindableObject)
CoerceValue(BindableProperty)

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

(繼承來源 BindableObject)
CoerceValue(BindablePropertyKey)

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

(繼承來源 BindableObject)
GetValue(BindableProperty)

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

(繼承來源 BindableObject)
IsSet(BindableProperty)

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

(繼承來源 BindableObject)
OnAttachedTo(BindableObject)

應用程式開發人員可以覆寫這個方法,以實作將與 bindable 建立關聯的行為。

OnAttachedTo(TView)

應用程式開發人員可以覆寫這個方法,以實作將與 bindable 建立關聯的行為。

OnAttachedTo(TView, TPlatformView)

當可系結至平台檢視階層時,會呼叫這個方法。

OnBindingContextChanged()

引發 BindingContextChanged 事件。

(繼承來源 BindableObject)
OnDetachedFrom(TView, TPlatformView)

從平台檢視階層卸離可系結時,會呼叫這個方法。

OnDetachingFrom(BindableObject)

應用程式開發人員可以覆寫此方法,以從之前 OnAttachedTo(BindableObject) 方法呼叫所實作的 bindable 移除行為。

OnDetachingFrom(TView)

應用程式開發人員可以覆寫此方法,以從之前 OnAttachedTo(T) 方法呼叫所實作的 bindable 移除行為。

OnPropertyChanged(String)

引發 PropertyChanged 事件。

(繼承來源 BindableObject)
OnPropertyChanging(String)

引發 PropertyChanging 事件。

(繼承來源 BindableObject)
RemoveBinding(BindableProperty)

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

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

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

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

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

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

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

(繼承來源 BindableObject)
UnapplyBindings()

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

(繼承來源 BindableObject)

事件

BindingContextChanged

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

(繼承來源 BindableObject)
PropertyChanged

當屬性值變更時發生。

(繼承來源 BindableObject)
PropertyChanging

當屬性值變更中時發生。

(繼承來源 BindableObject)

明確介面實作

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

(繼承來源 BindableObject)

擴充方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

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

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

一般化使用者定義行為的基類,可在連接到平台檢視階層時回應任意條件和事件。

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

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

適用於