TextCell 类

定义

具有 Cell 主要 Text 和文本的 Detail

public ref class TextCell : Microsoft::Maui::Controls::Cell
public class TextCell : Microsoft.Maui.Controls.Cell
type TextCell = class
    inherit Cell
Public Class TextCell
Inherits Cell
继承
派生

注解

以下示例演示了基本用法。

public class App : Application
{
    public App()
    {
        MainPage = new ContentPage {
            Content = new TableView {
                Intent = TableIntent.Form,
                Root = new TableRoot ("Table Title") {
                    new TableSection ("Section 1 Title") {
                        new TextCell {
                            Text = "TextCell Text",
                            Detail = "TextCell Detail"
                        },
                        new EntryCell {
                            Label = "EntryCell:",
                            Placeholder = "default keyboard",
                            Keyboard = Keyboard.Default
                        }
                    },
                    new TableSection ("Section 2 Title") {
                        new EntryCell {
                            Label = "Another EntryCell:",
                            Placeholder = "phone keyboard",
                            Keyboard = Keyboard.Telephone
                        },
                        new SwitchCell {
                            Text = "SwitchCell:"
                        }
                    }
                }
            }
        }; 
    }
    // OnStart, OnSleep, OnResume overrides omitted...
}

构造函数

TextCell()

具有 Cell 主要 Text 和文本的 Detail

字段

CommandParameterProperty

CommandParameter可绑定属性。

CommandProperty

Command可绑定属性。

DefaultCellHeight

单元的默认高度。

(继承自 Cell)
DetailColorProperty

DetailColor可绑定属性。

DetailProperty

Detail可绑定属性。

TextColorProperty

TextColor可绑定属性。

TextProperty

Text可绑定属性。

属性

AutomationId

获取或设置允许自动化框架查找此元素并与其交互的值。

(继承自 Element)
BindingContext

获取或设置一个 对象,该对象包含将由属于此 BindableObject的绑定属性所面向的属性。 这是一种可绑定属性。

(继承自 BindableObject)
ClassId

获取或设置用于标识语义相似元素集合的值。

(继承自 Element)
Command

获取或设置要在点击 TextCell 时执行的 ICommand。 这是一种可绑定属性。

CommandParameter

获取或设置在调用该命令时要传递的参数。 这是一种可绑定属性。

ContextActions

获取当用户在 Cell 上执行特定于设备的上下文手势时要显示的菜单项列表。

(继承自 Cell)
Detail

获取或设置 TextCell 中要显示的辅助文本。 这是一种可绑定属性。

DetailColor

获取或设置辅助文本的呈现颜色。 这是一种可绑定属性。

Dispatcher

获取创建此可绑定对象时可用的调度程序,否则会尝试查找最接近的可用调度程序 (可能是窗口/应用的) 。

(继承自 BindableObject)
EffectControlProvider

供 .NET MAUI 内部使用。

(继承自 Element)
Effects

获取或设置将在运行时应用于 元素的样式和属性。

(继承自 Element)
Handler

获取或设置此元素的关联处理程序。

(继承自 Element)
HasContextActions

获取一个值,该值指示单元在其 ContextActions 列表属性中是否至少具有一个菜单项。

(继承自 Cell)
Height

获取或设置 Cell 的高度。

(继承自 Cell)
Id

获取一个值,该值可用于在应用程序的整个运行过程中唯一标识元素。

(继承自 Element)
IsContextActionsLegacyModeEnabled

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
IsEnabled

获取或设置 Cell 的 IsEnabled 状态。 这是一种可绑定属性。

(继承自 Cell)
LogicalChildren
已过时.

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

(继承自 Element)
Parent

获取或设置此元素的父 Element 元素。

(继承自 Element)
RealParent

供 .NET MAUI 内部使用。

(继承自 Element)
RenderHeight

获取设备上呈现的单元的高度。

(继承自 Cell)
StyleId

获取或设置用于唯一地标识元素的用户定义的值。

(继承自 Element)
Text

获取或设置要显示的主要文本。 这是一种可绑定属性。

TextColor

获取或设置主要文本的呈现颜色。 这是一种可绑定属性。

方法

AddLogicalChild(Element)

将 添加到 Element 逻辑子级。

(继承自 Element)
ApplyBindings()

将所有当前绑定应用于 BindingContext

(继承自 BindableObject)
ClearLogicalChildren()

删除所有子 Element项。

(继承自 Element)
ClearValue(BindableProperty)

清除以前为可绑定属性设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除以前为其键标识的可绑定属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

强制指定可绑定属性的值。 这是通过调用 BindableProperty.CoerceValueDelegate 指定的可绑定属性来完成的。

(继承自 BindableObject)
EffectIsAttached(String)

供 .NET MAUI 内部使用。

(继承自 Element)
FindByName(String)

返回具有指定名称的元素。

(继承自 Element)
ForceUpdateSize()

立即更新单元的大小。

(继承自 Cell)
GetValue(BindableProperty)

返回给定的可绑定属性中包含的值。

(继承自 BindableObject)
InsertLogicalChild(Int32, Element)

将 插入 Element 到指定索引处的逻辑子级。

(继承自 Element)
IsSet(BindableProperty)

确定是否存在可绑定属性以及是否设置了值。

(继承自 BindableObject)
On<T>()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnAppearing()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnBindingContextChanged()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnChildAdded(Element)

引发 ChildAdded 事件。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildRemoved(Element, Int32)

引发 ChildRemoved 事件。 实现此方法以为此事件添加类处理

(继承自 Element)
OnDisappearing()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnHandlerChanged()

在派生类中重写时,应引发 HandlerChanged 事件。

(继承自 Element)
OnHandlerChanging(HandlerChangingEventArgs)

在派生类中重写时,应引发 HandlerChanging 事件。

(继承自 Element)
OnParentChanged()

在派生类中重写时,应引发 ParentChanged 事件。

(继承自 Element)
OnParentChanging(ParentChangingEventArgs)

在派生类中重写时,应引发 ParentChanging 事件。

(继承自 Element)
OnParentSet()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnPropertyChanged(String)

更改绑定属性时调用的方法。

(继承自 Element)
OnPropertyChanging(String)

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnTapped()

具有 Cell 主要 Text 和文本的 Detail

RemoveBinding(BindableProperty)

从可绑定属性中删除以前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

删除以前设置的动态资源。

(继承自 Element)
RemoveLogicalChild(Element)

从逻辑子级中删除特定 Element 项的第一个匹配项。

(继承自 Element)
SendAppearing()

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

(继承自 Cell)
SendDisappearing()

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

(继承自 Cell)
SetBinding(BindableProperty, BindingBase)

将绑定分配给可绑定属性。

(继承自 BindableObject)
SetDynamicResource(BindableProperty, String)

BindableProperty使用提供的键设置要通过 DynamicResource 更新此元素的 属性。

(继承自 Element)
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)
UnapplyBindings()

从当前上下文中删除所有当前绑定。

(继承自 BindableObject)

事件

Appearing

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
BindingContextChanged

BindingContext 属性的值更改时发生。

(继承自 BindableObject)
ChildAdded

每当将子元素添加到 元素时引发。

(继承自 Element)
ChildRemoved

每当从元素中删除子元素时引发。

(继承自 Element)
DescendantAdded

每当将子元素添加到元素的子树时引发。

(继承自 Element)
DescendantRemoved

每当从元素子树中删除子元素时引发。

(继承自 Element)
Disappearing

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
ForceUpdateSizeRequested

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
HandlerChanged

每当元素的处理程序发生更改时引发。

(继承自 Element)
HandlerChanging

每当元素的处理程序开始更改时引发。

(继承自 Element)
ParentChanged

每当元素的父级发生更改时引发。

(继承自 Element)
ParentChanging

每当元素的 开始更改时引发。

(继承自 Element)
PropertyChanged

在属性值更改时发生。

(继承自 BindableObject)
PropertyChanging

在属性值更改时发生。

(继承自 BindableObject)
Tapped

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)

显式接口实现

IContextFlyoutElement.ContextFlyout

ContextFlyout获取视图的 。 菜单浮出控件、菜单浮出控件子项和菜单浮出控件分隔符可以添加到上下文浮出控件。

(继承自 Element)
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

具有 Cell 主要 Text 和文本的 Detail

(继承自 BindableObject)
IEffectControlProvider.RegisterEffect(Effect)

具有 Cell 主要 Text 和文本的 Detail

(继承自 Element)
IElement.Parent

获取 元素的父级。

(继承自 Element)
IElementController.Descendants()

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.LogicalChildren

供 .NET MAUI 内部使用。

(继承自 Element)
IElementController.SetValueFromRenderer(BindableProperty, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.RegisterName(String, Object)

供 .NET MAUI 内部使用。

(继承自 Element)
INameScope.UnregisterName(String)

供 .NET MAUI 内部使用。

(继承自 Element)
IToolTipElement.ToolTip

表示一个小矩形弹出窗口,当用户将指针放在视图上时,该窗口显示视图用途的简短说明。

(继承自 Element)
IVisualTreeElement.GetVisualChildren()

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
IVisualTreeElement.GetVisualParent()

获取元素的视觉对象父级。

(继承自 Element)

扩展方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

具有 Cell 主要 Text 和文本的 Detail

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

具有 Cell 主要 Text 和文本的 Detail

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

具有 Cell 主要 Text 和文本的 Detail

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

创建绑定并将其应用到属性。

GetPath(Cell)

供平台呈现器内部使用。

FindByName<T>(Element, String)

具有 Cell 主要 Text 和文本的 Detail

ToHandler(IElement, IMauiContext)

具有 Cell 主要 Text 和文本的 Detail

ToPlatform(IElement, IMauiContext)

具有 Cell 主要 Text 和文本的 Detail

GetVisualElementWindow(IVisualTreeElement)

获取包含可视化树元素的窗口(如果该元素包含在其中)。

GetVisualTreeDescendants(IVisualTreeElement)

获取子代的整个层次结构,作为给定可视化树元素的子级列表。

GetVisualTreeElements(IVisualTreeElement, Point)

获取基于给定点的可视化树元素的子级列表。

GetVisualTreeElements(IVisualTreeElement, Rect)

获取基于矩形的可视化树元素子级的列表。

GetVisualTreeElements(IVisualTreeElement, Double, Double)

获取基于给定 x、y 点的可视化树元素子项的列表。

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

获取基于矩形的可视化树元素子级的列表,该矩形的坐标以平台单位(而不是像素)指定。

适用于