语言

FormattedString 类

定义

表示某些部分应用了一些特性的文本。

[Xamarin.Forms.ContentProperty("Spans")]
public class FormattedString : Xamarin.Forms.Element
type FormattedString = class
    inherit Element
继承
System.Object
FormattedString
属性

构造函数

名称 说明
FormattedString()

初始化 FormattedString 类的新实例。

属性

名称 说明
AutomationId

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

(继承自 Element)
BindingContext

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

(继承自 BindableObject)
ClassId

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

(继承自 Element)
Dispatcher

表示某些部分应用了一些特性的文本。

(继承自 BindableObject)
EffectControlProvider

供Xamarin内部使用。窗体平台。

(继承自 Element)
Effects

应用于此项的效果的列表。

(继承自 Element)
Id

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

(继承自 Element)
LogicalChildren

供Xamarin内部使用。窗体平台。

(继承自 Element)
Parent

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

(继承自 Element)
ParentView
已过时.

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

(继承自 Element)
Platform
已过时.

表示某些部分应用了一些特性的文本。

(继承自 Element)
RealParent

供Xamarin内部使用。窗体平台。

(继承自 Element)
Spans

获取范围集合。

StyleId

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

(继承自 Element)

方法

名称 说明
ApplyBindings()

将绑定应用到 BindingContext.

(继承自 BindableObject)
ClearValue(BindableProperty)

清除为 SetValueproperty.. 设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除为 SetValue 由 propertyKey标识的属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

表示某些部分应用了一些特性的文本。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

表示某些部分应用了一些特性的文本。

(继承自 BindableObject)
Descendants()

供Xamarin内部使用。窗体平台。

(继承自 Element)
EffectIsAttached(String)

供Xamarin内部使用。窗体平台。

(继承自 Element)
FindByName(String)

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

(继承自 Element)
GetValue(BindableProperty)

返回 BindableProperty 中包含的值。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

(继承自 BindableObject)
IsSet(BindableProperty)

返回 true 目标属性是否存在且已设置。

(继承自 BindableObject)
OnBindingContextChanged()

更改绑定上下文时调用的方法。

OnChildAdded(Element)

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

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

表示某些部分应用了一些特性的文本。

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

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

(继承自 Element)
OnParentSet()

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

(继承自 Element)
OnPropertyChanged(String)

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

(继承自 Element)
OnPropertyChanging(String)

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

(继承自 BindableObject)
RemoveBinding(BindableProperty)

删除以前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

删除以前设置的动态资源

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

向属性分配绑定。

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

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

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

设置指定属性的值。

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

设置 propertyKey 的值。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

(继承自 Element)
ToString()

将格式化字符串的文本以未格式化字符串的形式返回。

UnapplyBindings()

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

(继承自 BindableObject)

运算符

名称 说明
Explicit(FormattedString to String)

将 FormattedString 强制转换为字符串,去除所有属性。

Implicit(String to FormattedString)

将字符串强制转换为 FormattedString,其中包含没有设置属性的单个范围。

活动

名称 说明
BindingContextChanged

每当 BindingContext 属性更改时引发。

(继承自 BindableObject)
ChildAdded

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

(继承自 Element)
ChildRemoved

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

(继承自 Element)
DescendantAdded

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

(继承自 Element)
DescendantRemoved

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

(继承自 Element)
PlatformSet
已过时.

表示某些部分应用了一些特性的文本。

(继承自 Element)
PropertyChanged

属性发生更改时引发。

(继承自 BindableObject)
PropertyChanging

当属性即将更改时引发。

(继承自 BindableObject)

显式接口实现

名称 说明
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供Xamarin内部使用。窗体平台。

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

供Xamarin内部使用。窗体平台。

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

仅供内部使用。

(继承自 Element)

扩展方法

名称 说明
FindByName<T>(Element, String)

返回范围中包含element名称name的类型T实例。

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

表示某些部分应用了一些特性的文本。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

表示某些部分应用了一些特性的文本。

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

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

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

从表达式创建并应用绑定。

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

表示某些部分应用了一些特性的文本。

适用于