LinedFlowLayout 類別

定義

表示控件,該控件會使用所有元素的相同高度,依序從左至右、由上至下定位元素,然後在換行版面配置中依序放置元素。

/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 327680)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LinedFlowLayout : VirtualizingLayout
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 327680)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class LinedFlowLayout : VirtualizingLayout
Public Class LinedFlowLayout
Inherits VirtualizingLayout
繼承
Object IInspectable DependencyObject Layout VirtualizingLayout LinedFlowLayout
屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute ContractVersionAttribute MarshalingBehaviorAttribute ThreadingAttribute

備註

LinedFlowLayout 會依序將元素從左至右、由上至下定位在換行版面配置中。 使用此版面配置來顯示專案集合,其中專案的高度固定,但寬度可變。 建議用於以映像為基礎的集合。 此版面配置也有內建動畫,會在集合新增或移除專案時播放,以及檢視重設大小時播放。

若要使用LinedFlowLayout,請將它設定為 ItemsView.LayoutItemsRepeater.Layout 屬性的值。

以下是 ItemsView 控件,顯示線條流程版面配置中的相片集合。

<ItemsView Width="500" Height="400" HorizontalAlignment="Left"
           ItemTemplate="{StaticResource LinedFlowLayoutItemTemplate}">
    <ItemsView.Layout>
        <LinedFlowLayout ItemsStretch="Fill" 
                         LineHeight="160" 
                         LineSpacing="5"
                         MinItemSpacing="5"/>
    </ItemsView.Layout>
</ItemsView>

線條流程版面配置中顯示的相片集合,其中每個專案的高度相同,但寬度會根據相片外觀比例的原始大小而有所不同。

LinedFlowLayout 提供屬性來控制:

建構函式

LinedFlowLayout()

初始化 LinedFlowLayout 類別的新實例。

屬性

ActualLineHeight

取得行的有效固定高度。

ActualLineHeightProperty

識別 ActualLineHeight 相依性屬性。

Dispatcher

一律會在 Windows 應用程式 SDK 應用程式中傳null回 。 請改用 DispatcherQueue

(繼承來源 DependencyObject)
DispatcherQueue

DispatcherQueue取得與這個 物件相關聯的 。 DispatcherQueue表示即使程式代碼是由非UI線程起始,也可以存取 DependencyObject UI線程上的設備。

(繼承來源 DependencyObject)
IndexBasedLayoutOrientation

取得方向,如果有的話,根據專案在來源集合中的索引進行配置。

(繼承來源 Layout)
ItemsJustification

取得或設定值,這個值表示專案在水平軸上的對齊方式。

ItemsJustificationProperty

識別 ItemsJustification 相依性屬性。

ItemsStretch

取得或設定值,這個值表示專案的大小如何填滿可用空間。

ItemsStretchProperty

識別 ItemsStretch 相依性屬性。

LineHeight

取得或設定行固定高度。

LineHeightProperty

識別 LineHeight 相依性屬性。

LineSpacing

取得或設定專案之間的垂直間距。

LineSpacingProperty

識別 LineSpacing 相依性屬性。

MinItemSpacing

取得或設定水平軸上項目之間的最小空間。

MinItemSpacingProperty

識別 MinItemSpacing 相依性屬性。

RequestedRangeLength

取得目前使用 透過 ItemsInfoRequested 事件所提供的重設大小資訊的項目數目。

RequestedRangeStartIndex

取得目前使用 ItemsInfoRequested 事件所提供的重設大小資訊之專案的最小索引。 值 -1 表示未使用任何重 ItemsInfoRequested 設大小資訊。

方法

Arrange(LayoutContext, Size)

放置子元素,並決定容器 UIElement 的大小。 支援附加配置的容器元素應該從其版面配置覆寫實作呼叫此方法,以形成遞歸版面配置更新。

(繼承來源 Layout)
ArrangeOverride(VirtualizingLayoutContext, Size)

在衍生類別中實作時,提供配置「排列」階段的行為。 類別可以覆寫這個方法,以定義自己的「排列」傳遞行為。

(繼承來源 VirtualizingLayout)
ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
CreateDefaultItemTransitionProvider()

表示控件,該控件會使用所有元素的相同高度,依序從左至右、由上至下定位元素,然後在換行版面配置中依序放置元素。

(繼承來源 Layout)
GetAnimationBaseValue(DependencyProperty)

傳回為相依性屬性建立的任何基底值,如果動畫未使用中,則適用此屬性。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject 傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
InitializeForContext(LayoutContext)

初始化配置附加至 UIElement 容器時所需的任何個別容器狀態。

(繼承來源 Layout)
InitializeForContextCore(VirtualizingLayoutContext)

在衍生類別中覆寫時,初始化配置附加至 UIElement 容器時所需的任何個別容器狀態。

(繼承來源 VirtualizingLayout)
InvalidateArrange()

使參考此配置之所有UIElement容器的排列狀態 (配置) 失效。 在失效之後,UIElement 會更新其版面配置,這會以異步方式發生。

(繼承來源 Layout)
InvalidateItemsInfo()

LinedFlowLayout導致執行其專案的重排。

InvalidateMeasure()

使參考此配置之所有UIElement容器的度量狀態 (配置) 失效。

(繼承來源 Layout)
LockItemToLine(Int32)

擷取具有所提供索引的專案所屬行的索引。 然後,該項目保證會出現在傳回的行中,直到 引發 ItemsUnlocked 事件為止。

Measure(LayoutContext, Size)

建議容器專案的 DesiredSize。 支援附加配置的容器元素應該從自己的 MeasureOverride 實作呼叫這個方法,以形成遞歸配置更新。 附加的配置預期會呼叫每個容器 UIElement 子系的 Measure。

(繼承來源 Layout)
MeasureOverride(VirtualizingLayoutContext, Size)

提供配置週期的「量值」階段行為。 類別可以覆寫這個方法,以定義自己的「量值」傳遞行為。

(繼承來源 VirtualizingLayout)
OnItemsChangedCore(VirtualizingLayoutContext, Object, NotifyCollectionChangedEventArgs)

當指派給 Container 元素的數據收集 (ItemsSource) 變更時,通知配置。

(繼承來源 VirtualizingLayout)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此 DependencyObject 實例上特定 DependencyProperty 的變更。

(繼承來源 DependencyObject)
SetIndexBasedLayoutOrientation(IndexBasedLayoutOrientation)

設定 IndexBasedLayoutOrientation 屬性的值。

(繼承來源 Layout)
SetValue(DependencyProperty, Object)

設定 DependencyObject 上相依性屬性的本機值。

(繼承來源 DependencyObject)
UninitializeForContext(LayoutContext)

拿掉先前儲存在 UIElement 容器上之配置的任何狀態。

(繼承來源 Layout)
UninitializeForContextCore(VirtualizingLayoutContext)

在衍生類別中覆寫時,移除先前儲存在UIElement容器上配置的任何狀態。

(繼承來源 VirtualizingLayout)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback 註冊的變更通知。

(繼承來源 DependencyObject)

事件

ArrangeInvalidated

發生於配置 () 已失效時。

(繼承來源 Layout)
ItemsInfoRequested

發生於需要調整目前卷動檢視區中專案和周圍之專案的大小資訊時 LinedFlowLayout

ItemsUnlocked

每當透過呼叫 LockItemToLine 方法鎖定的特定行的專案再次解除鎖定時發生。

MeasureInvalidated

發生於 (配置) 的測量狀態已失效時。

(繼承來源 Layout)

適用於

另請參閱