FrameworkElement.FlowDirection 屬性

定義

取得或設定文字和其他 使用者介面 (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.

public:
 property System::Windows::FlowDirection FlowDirection { System::Windows::FlowDirection get(); void set(System::Windows::FlowDirection value); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.None)]
public System.Windows.FlowDirection FlowDirection { get; set; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None)>]
member this.FlowDirection : System.Windows.FlowDirection with get, set
Public Property FlowDirection As FlowDirection

屬性值

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.

屬性

備註

相依性屬性使用方式會設定這個專案的 FlowDirectionThe 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 ,而且還沒有更直接定義的屬性時,附加的屬性用法才會相關 FlowDirectionThe 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. (部分的非固定格式檔類別 Block ,例如和 Inline 定義自己的 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 Attribute UsageXAML Attribute Usage

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

XAML 文字使用方式XAML Text Usage

您也可以 FrameworkElement 使用下列附加屬性,在非衍生類別的類別上設定這個屬性 XAMLXAMLThis property can also be set on classes that are not FrameworkElement derived classes, by the following XAMLXAML attached property usage:

<物件 FrameworkElement.System.windows.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.

適用於