Span 类

定义

表示 FormattedString 的一个部分。

[Xamarin.Forms.ContentProperty("Text")]
public class Span : Xamarin.Forms.GestureElement, Xamarin.Forms.IDecorableTextElement, Xamarin.Forms.Internals.IFontElement
type Span = class
    inherit GestureElement
    interface IFontElement
    interface IDecorableTextElement
继承
属性
实现

注解

默认情况下,与 Span 属性的绑定为 OneTime。

构造函数

Span()

初始化 Span 类的新实例。

字段

BackgroundColorProperty

BackgroundColor 属性的后备存储。

CharacterSpacingProperty

表示 FormattedString 的一个部分。

FontAttributesProperty

FontAttributes 属性的后备存储。

FontFamilyProperty

FontFamily 属性的后备存储。

FontProperty

Font 属性的后备存储。

FontSizeProperty

FontSize 属性的后备存储。

ForegroundColorProperty
已过时.

ForegroundColor 属性的后备存储。

LineHeightProperty

LineHeight 可绑定属性的后备存储。

StyleProperty

Style 属性的后备存储。

TextColorProperty

TextColor 属性的后备存储。

TextDecorationsProperty

TextDecorations 属性关联的 BindableProperty

TextProperty

Text 属性的后备存储。

TextTransformProperty

表示 FormattedString 的一个部分。

属性

AutomationId

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

(继承自 Element)
BackgroundColor

获取或设置范围背景的颜色。

BindingContext

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

(继承自 BindableObject)
CharacterSpacing

表示 FormattedString 的一个部分。

ClassId

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

(继承自 Element)
Dispatcher

表示 FormattedString 的一个部分。

(继承自 BindableObject)
EffectControlProvider

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
Effects

应用于此项的效果列表。

(继承自 Element)
Font
已过时.

获取或设置范围中的文本字体。

FontAttributes

获取一个值,该值指示范围的字体是粗体、斜体还是两者皆否。

FontFamily

获取该范围的字体所属的字体系列。

FontSize

获取该范围中的文本字号。

ForegroundColor

获取或设置范围中的文本颜色。

GestureRecognizers

获取属于元素的识别器列表。

(继承自 GestureElement)
Id

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

(继承自 Element)
LineHeight

获取或设置显示文本时要应用于默认行高的乘数。

LogicalChildren

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
Parent

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

(继承自 Element)
ParentView
已过时.

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

(继承自 Element)
Platform
已过时.

表示 FormattedString 的一个部分。

(继承自 Element)
RealParent

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
Style

获取或设置要应用于该范围的样式。

StyleId

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

(继承自 Element)
Text

获取或设置该范围的文本。

TextColor

获取或设置文本颜色。

TextDecorations

获取或设置应用于此跨度的 TextDecorations

TextTransform

表示 FormattedString 的一个部分。

方法

ApplyBindings()

将绑定应用到 BindingContext

(继承自 BindableObject)
ClearValue(BindableProperty)

清除由 SetValueproperty 设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

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

(继承自 BindableObject)
CoerceValue(BindableProperty)

表示 FormattedString 的一个部分。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

表示 FormattedString 的一个部分。

(继承自 BindableObject)
Descendants()

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
EffectIsAttached(String)

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
FindByName(String)

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

(继承自 Element)
GetValue(BindableProperty)

返回 BindableProperty 中包含的值。

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

供 Xamarin.Forms 平台内部使用。

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

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
IsSet(BindableProperty)

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

(继承自 BindableObject)
OnBindingContextChanged()

替代此方法以在 BindingContext 更改时执行操作。

OnChildAdded(Element)

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

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

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

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

表示 FormattedString 的一个部分。

(继承自 Element)
OnParentSet()

每当设置元素的父级时就会调用。 实现此方法以便在将元素添加到父元素时添加行为。

(继承自 Element)
OnPropertyChanged(String)

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

(继承自 Element)
OnPropertyChanging(String)

从子类调用此方法以通知属性将要发生更改。

(继承自 BindableObject)
RemoveBinding(BindableProperty)

删除先前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

移除先前设置的动态资源

(继承自 Element)
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)
UpdateFormsText(String, TextTransform)

表示 FormattedString 的一个部分。

事件

BindingContextChanged

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

(继承自 BindableObject)
ChildAdded

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

(继承自 Element)
ChildRemoved

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

(继承自 Element)
DescendantAdded

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

(继承自 Element)
DescendantRemoved

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

(继承自 Element)
PlatformSet
已过时.

表示 FormattedString 的一个部分。

(继承自 Element)
PropertyChanged

在属性已更改时引发。

(继承自 BindableObject)
PropertyChanging

在属性将要更改时引发。

(继承自 BindableObject)

显式接口实现

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供 Xamarin.Forms 平台内部使用。

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

供 Xamarin.Forms 平台内部使用。

(继承自 Element)
IFontElement.FontSizeDefaultValueCreator()

供 Xamarin.Forms 平台内部使用。

IFontElement.OnFontAttributesChanged(FontAttributes, FontAttributes)

供 Xamarin.Forms 平台内部使用。

IFontElement.OnFontChanged(Font, Font)

供 Xamarin.Forms 平台内部使用。

IFontElement.OnFontFamilyChanged(String, String)

供 Xamarin.Forms 平台内部使用。

IFontElement.OnFontSizeChanged(Double, Double)

供 Xamarin.Forms 平台内部使用。

INameScope.RegisterName(String, Object)

仅限内部使用。

(继承自 Element)
ISpatialElement.Region

供 Xamarin.Forms 平台内部使用。

(继承自 GestureElement)

扩展方法

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

表示 FormattedString 的一个部分。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

表示 FormattedString 的一个部分。

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

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

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

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

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

表示 FormattedString 的一个部分。

FindByName<T>(Element, String)

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

适用于