TextCell 类

定义

具有 Cell 主要 Text 和文本的 Detail

public class TextCell : Xamarin.Forms.Cell
type TextCell = class
    inherit 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()

初始化 TextCell 类的新实例。

字段

CommandParameterProperty

标识 CommandParameter 可绑定属性。

CommandProperty

标识 Command 可绑定属性。

DefaultCellHeight

单元的默认高度。

(继承自 Cell)
DetailColorProperty

标识 DetailColor 可绑定属性。

DetailProperty

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

TextColorProperty

标识 TextColor 可绑定属性。

TextProperty

标识 Text 可绑定属性。

属性

AutomationId

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

(继承自 Element)
BindingContext

获取或设置对象,该对象包含将被属于此 BindableObject 的绑定属性设定为目标的属性。

(继承自 BindableObject)
ClassId

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

(继承自 Element)
Command

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

CommandParameter

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

ContextActions

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

(继承自 Cell)
Detail

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

DetailColor

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

Dispatcher

具有 Cell 主要 Text 和文本的 Detail

(继承自 BindableObject)
EffectControlProvider

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
Effects

应用于此项的效果列表。

(继承自 Element)
HasContextActions

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

(继承自 Cell)
Height

获取或设置 Cell 的高度。

(继承自 Cell)
Id

获取可用于通过运行应用程序唯一地标识元素的值。

(继承自 Element)
IsContextActionsLegacyModeEnabled

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
IsEnabled

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

(继承自 Cell)
LogicalChildren

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
Parent

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

(继承自 Element)
ParentView
已过时。

获取作为 VisualElement 的此元素的最近的上级元素。

(继承自 Element)
Platform
已过时。

具有 Cell 主要 Text 和文本的 Detail

(继承自 Element)
RealParent

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
RenderHeight

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

(继承自 Cell)
StyleId

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

(继承自 Element)
Text

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

TextColor

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

方法

ApplyBindings()

将绑定应用到 BindingContext

(继承自 BindableObject)
ClearValue(BindableProperty)

清除由 SetValueproperty 设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除由 SetValuepropertyKey 标识的属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

具有 Cell 主要 Text 和文本的 Detail

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

具有 Cell 主要 Text 和文本的 Detail

(继承自 BindableObject)
Descendants()

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
EffectIsAttached(String)

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
FindByName(String)

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

(继承自 Element)
ForceUpdateSize()

立即更新单元的大小。

(继承自 Cell)
GetValue(BindableProperty)

返回 BindableProperty 中包含的值。

(继承自 BindableObject)
GetValues(BindableProperty, BindableProperty)
已过时。

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
GetValues(BindableProperty, BindableProperty, BindableProperty)
已过时。

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
IsSet(BindableProperty)

如果目标属性存在并且已设置,则返回 true

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

具有 Cell 主要 Text 和文本的 Detail

(继承自 Cell)
OnAppearing()

只要 Appearing 事件发生就会调用。 实现此方法可为此事件添加类处理。

(继承自 Cell)
OnBindingContextChanged()

绑定上下文更改时引发的事件。

(继承自 Cell)
OnChildAdded(Element)

每当需要发出 ChildAdded 事件时就会调用。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildRemoved(Element)
已过时。

每当需要发出 ChildRemoved 事件时就会调用。 实现此方法可为此事件添加类处理。

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

具有 Cell 主要 Text 和文本的 Detail

(继承自 Element)
OnDisappearing()

只要 Disappearing 事件发生就会调用。 实现此方法可为此事件添加类处理。

(继承自 Cell)
OnParentSet()

应用程序开发者可以替代此方法,以在设置单元的父级时执行操作。

(继承自 Cell)
OnPropertyChanged(String)

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

(继承自 Element)
OnPropertyChanging(String)

应用程序开发者可以替代此方法,以在设置 propertyName 命名的属性时执行操作。

(继承自 Cell)
OnTapped()

只要点击 Cell 就会调用。

RemoveBinding(BindableProperty)

删除先前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

移除先前设置的动态资源

(继承自 Element)
SendAppearing()

供 Xamarin.Forms 平台内部使用。

(继承自 Cell)
SendDisappearing()

供 Xamarin.Forms 平台内部使用。

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

向属性分配绑定。

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

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

(继承自 Element)
SetValue(BindableProperty, Object)

设置指定属性的值。

(继承自 BindableObject)
SetValue(BindablePropertyKey, Object)

设置 propertyKey 的值。

(继承自 BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
SetValueFromRenderer(BindableProperty, Object)

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
SetValueFromRenderer(BindablePropertyKey, Object)

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
UnapplyBindings()

不应用所有以前设置的绑定。

(继承自 BindableObject)

事件

Appearing

将 Cell 的视觉对象表示形式添加到视觉对象布局时发生。

(继承自 Cell)
BindingContextChanged

只要 BindingContext 属性更改就会引发。

(继承自 BindableObject)
ChildAdded

每当将子元素添加到元素时就会发生。

(继承自 Element)
ChildRemoved

每当从元素中删除子元素时就会发生。

(继承自 Element)
DescendantAdded

每当将子元素添加到元素子树时就会发生。

(继承自 Element)
DescendantRemoved

每当从元素子树中删除子元素时就会发生。

(继承自 Element)
Disappearing

将 Cell 的视觉对象表示形式从视觉对象布局删除时发生。

(继承自 Cell)
ForceUpdateSizeRequested

供 Xamarin.Forms 平台内部使用。

(继承自 Cell)
PlatformSet
已过时。

具有 Cell 主要 Text 和文本的 Detail

(继承自 Element)
PropertyChanged

在属性已更改时引发。

(继承自 BindableObject)
PropertyChanging

在属性将要更改时引发。

(继承自 BindableObject)
Tapped

点击 Cell 时发生。

(继承自 Cell)

显式接口实现

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供 Xamarin.Forms 平台内部使用。

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

供 Xamarin.Forms 平台内部使用。

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

仅限内部使用。

(继承自 Element)

扩展方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

具有 Cell 主要 Text 和文本的 Detail

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

具有 Cell 主要 Text 和文本的 Detail

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

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

SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String)
已过时。

通过表达式创建并应用绑定。

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

具有 Cell 主要 Text 和文本的 Detail

GetPath(Cell)

供平台呈现器内部使用。

FindByName<T>(Element, String)

返回包含 element 的作用域中名称为 name 的类型 T 的实例。

适用于