FrameworkElement.FlowDirection FrameworkElement.FlowDirection FrameworkElement.FlowDirection FrameworkElement.FlowDirection Property


获取或设置方向,文本和其他 用户界面 (UI)user interface (UI) 元素在任何控制其布局的父元素中都按此方向流动。Gets or sets the direction that text and other 用户界面 (UI)user interface (UI) elements flow within any parent element that controls their layout.

 property System::Windows::FlowDirection FlowDirection { System::Windows::FlowDirection get(); void set(System::Windows::FlowDirection value); };
public System.Windows.FlowDirection FlowDirection { get; set; }
member this.FlowDirection : System.Windows.FlowDirection with get, set
Public Property FlowDirection As FlowDirection


文本和其他 UIUI 元素在它们的父元素中的流动方向,是一个枚举值。The direction that text and other UIUI elements flow within their parent element, as a value of the enumeration. 默认值为 LeftToRightThe default value is LeftToRight.


依赖属性用法在此元素FlowDirection上设置。The dependency property usage sets the FlowDirection on this element. 由于属性值继承, 元素上FlowDirection的设置可能会FlowDirection对未在本地或其他方法 (如样式FlowDirection ) 上设置的所有子元素进行设置。Because of property value inheritance, setting FlowDirection on an element can potentially set FlowDirection on all child elements that did not set FlowDirection locally or though other means such as styles.

此属性不会自动设置为任何应用程序区域性信息的一部分, 因为元素可能包含不一定要遵循区域性信息隐含的一般流方向的内容。This property is not automatically set as part of any application culture information, because an element might contain content that is not necessarily intended to obey the general flow direction implied by the culture information. 有关全球化注意事项的详细信息, 请参阅WPF 的全球化For more information on globalization considerations, see Globalization for WPF.

此属性具有定义公共语言运行时 (CLR)common language runtime (CLR)的属性访问器, 因此它将作为依赖属性。This property has a defined 公共语言运行时 (CLR)common language runtime (CLR) property accessor, so it functions as a dependency property. 不过, 它也注册为附加属性, 因此它也可以作为附加属性。However, it is also registered as attached, so it can also function as an attached property. 附加的注册主要是为了支持属性值继承, 但属性也可用作真正的附加属性。The attached registration is mainly so that property value inheritance is supported, but the property can also be used as a true attached property. 仅当要设置流方向的对象具有FrameworkElement执行布局的父元素时, 附加属性用法才相关, 它本身FrameworkElement不是, 并且还没有更直接定义FlowDirection知识产权.The attached property usage is only relevant if the object you intend to set the flow direction on has a FrameworkElement parent element that performs layout upon it, is itself not a FrameworkElement, and does not already have a more directly defined FlowDirection property. (某些流文档类 (如BlockInline ) 定义自己FlowDirection的, 并且此属性还可以设置流方向。(Some of the flow document classes such as Block and Inline define their own FlowDirection, and this property can also set the flow direction. 然后, 最终内容主机会读取属性值, 而无需附加的属性用法。)The property value is then read by the eventual content host without requiring attached property usage.)

XAML 属性用法XAML Attribute Usage

<object FlowDirection="FlowDirection"/><object FlowDirection="FlowDirection"/>

XAML 文本用法XAML Text Usage

还可以通过以下FrameworkElement XAMLXAML附加属性用法对不是派生类的类设置此属性:This property can also be set on classes that are not FrameworkElement derived classes, by the following XAMLXAML attached property usage:

< object FrameworkElement.FlowDirection="FlowDirection"/>< object FrameworkElement.FlowDirection="FlowDirection"/>

依赖项属性信息Dependency Property Information

标识符字段Identifier field FlowDirectionProperty
元数据属性设置为trueMetadata properties set to true AffectsMeasure, AffectsParentArrange, InheritsAffectsMeasure, AffectsParentArrange, Inherits

此属性既是依赖属性, 也是附加属性;请参阅 "备注"。This property is both a dependency property and an attached property; see Remarks.