LinedFlowLayout Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a control that positions elements sequentially from left to right, then top to bottom, in a wrapping layout, using the same height for all elements.
/// [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
- Inheritance
- Attributes
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute ContractVersionAttribute MarshalingBehaviorAttribute ThreadingAttribute
Remarks
The LinedFlowLayout positions elements sequentially from left to right, then top to bottom, in a wrapping layout. Use this layout to display an item collection where the items have a fixed height but a variable width. We recommend it for image based collections. This layout also has built-in animations that play when the collection has items added or removed, and when the view is resized.
To use a LinedFlowLayout, set it as a value for the ItemsView.Layout or ItemsRepeater.Layout properties.
Here's an ItemsView control that shows a collection of photos in a lined flow layout.
<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 provides properties to control:
- the size and spacing of items (LineHeight, LineSpacing, MinItemSpacing)
- the arrangement of items (ItemsJustification, ItemsStretch)
Constructors
LinedFlowLayout() |
Initializes a new instance of the LinedFlowLayout class. |
Properties
ActualLineHeight |
Gets effective fixed height of the lines. |
ActualLineHeightProperty |
Identifies the ActualLineHeight dependency property. |
Dispatcher |
Always returns |
DispatcherQueue |
Gets the |
IndexBasedLayoutOrientation |
Gets the orientation, if any, in which items are laid out based on their index in the source collection. (Inherited from Layout) |
ItemsJustification |
Gets or sets a value that indicates how items are aligned on the horizontal axis. |
ItemsJustificationProperty |
Identifies the ItemsJustification dependency property. |
ItemsStretch |
Gets or sets a value that indicates how items are sized to fill the available space. |
ItemsStretchProperty |
Identifies the ItemsStretch dependency property. |
LineHeight |
Gets or sets the lines fixed height. |
LineHeightProperty |
Identifies the LineHeight dependency property. |
LineSpacing |
Gets or sets the vertical space between items. |
LineSpacingProperty |
Identifies the LineSpacing dependency property. |
MinItemSpacing |
Gets or sets the minimum space between items on the horizontal axis. |
MinItemSpacingProperty |
Identifies the MinItemSpacing dependency property. |
RequestedRangeLength |
Gets the number of items currently using sizing information provided through the ItemsInfoRequested event. |
RequestedRangeStartIndex |
Gets the smallest index of the items currently using sizing information provided through the ItemsInfoRequested event. A value of -1 indicates that no sizing information from |
Methods
Arrange(LayoutContext, Size) |
Positions child elements and determines a size for a container UIElement. Container elements that support attached layouts should call this method from their layout override implementations to form a recursive layout update. (Inherited from Layout) |
ArrangeOverride(VirtualizingLayoutContext, Size) |
When implemented in a derived class, provides the behavior for the "Arrange" pass of layout. Classes can override this method to define their own "Arrange" pass behavior. (Inherited from VirtualizingLayout) |
ClearValue(DependencyProperty) |
Clears the local value of a dependency property. (Inherited from DependencyObject) |
CreateDefaultItemTransitionProvider() | (Inherited from Layout) |
GetAnimationBaseValue(DependencyProperty) |
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject) |
GetValue(DependencyProperty) |
Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject) |
InitializeForContext(LayoutContext) |
Initializes any per-container state the layout requires when it is attached to a UIElement container. (Inherited from Layout) |
InitializeForContextCore(VirtualizingLayoutContext) |
When overridden in a derived class, initializes any per-container state the layout requires when it is attached to a UIElement container. (Inherited from VirtualizingLayout) |
InvalidateArrange() |
Invalidates the arrange state (layout) for all UIElement containers that reference this layout. After the invalidation, the UIElement will have its layout updated, which occurs asynchronously. (Inherited from Layout) |
InvalidateItemsInfo() |
Causes the |
InvalidateMeasure() |
Invalidates the measurement state (layout) for all UIElement containers that reference this layout. (Inherited from Layout) |
LockItemToLine(Int32) |
Retrieves the index of the line that the item with the provided index belongs to. That item is then guaranteed to appear in the returned line until the ItemsUnlocked event is raised. |
Measure(LayoutContext, Size) |
Suggests a DesiredSize for a container element. A container element that supports attached layouts should call this method from their own MeasureOverride implementations to form a recursive layout update. The attached layout is expected to call the Measure for each of the container’s UIElement children. (Inherited from Layout) |
MeasureOverride(VirtualizingLayoutContext, Size) |
Provides the behavior for the "Measure" pass of the layout cycle. Classes can override this method to define their own "Measure" pass behavior. (Inherited from VirtualizingLayout) |
OnItemsChangedCore(VirtualizingLayoutContext, Object, NotifyCollectionChangedEventArgs) |
Notifies the layout when the data collection assigned to the container element (ItemsSource) has changed. (Inherited from VirtualizingLayout) |
ReadLocalValue(DependencyProperty) |
Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject) |
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from DependencyObject) |
SetIndexBasedLayoutOrientation(IndexBasedLayoutOrientation) |
Sets the value of the |
SetValue(DependencyProperty, Object) |
Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject) |
UninitializeForContext(LayoutContext) |
Removes any state the layout previously stored on the UIElement container. (Inherited from Layout) |
UninitializeForContextCore(VirtualizingLayoutContext) |
When overridden in a derived class, removes any state the layout previously stored on the UIElement container. (Inherited from VirtualizingLayout) |
UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject) |
Events
ArrangeInvalidated |
Occurs when the arrange state (layout) has been invalidated. (Inherited from Layout) |
ItemsInfoRequested |
Occurs when the |
ItemsUnlocked |
Occurs whenever items that had been locked into specific lines through calls to the LockItemToLine method are unlocked again. |
MeasureInvalidated |
Occurs when the measurement state (layout) has been invalidated. (Inherited from Layout) |
Applies to
See also
- ItemsView
- <xref:Microsoft.UI.Xaml.Controls.ItemsRepeater+T%3aMicrosoft.UI.Xaml.Controls.StackLayout>
- UniformGridLayout