Edit

Share via


AdaptiveGridView Class

Definition

The AdaptiveGridView control allows to present information within a Grid View perfectly adjusting the total display available space. It reacts to changes in the layout as well as the content so it can adapt to different form factors automatically.

public class AdaptiveGridView : Windows.UI.Xaml.Controls.GridView
type AdaptiveGridView = class
    inherit GridView
Public Class AdaptiveGridView
Inherits GridView
Inheritance
Windows.UI.Xaml.Controls.GridView
AdaptiveGridView

Remarks

The number and the width of items are calculated based on the screen resolution in order to fully leverage the available screen space. The property ItemsHeight define the items fixed height and the property DesiredWidth sets the minimum width for the elements to add a new column.

Constructors

AdaptiveGridView()

Initializes a new instance of the AdaptiveGridView class.

Fields

DesiredWidthProperty

Identifies the DesiredWidth dependency property.

ItemClickCommandProperty

Identifies the ItemClickCommand dependency property.

ItemHeightProperty

Identifies the ItemHeight dependency property.

OneRowModeEnabledProperty

Identifies the OneRowModeEnabled dependency property.

StretchContentForSingleRowProperty

Identifies the StretchContentForSingleRow dependency property.

Properties

DesiredWidth

Gets or sets the desired width of each item

ItemClickCommand

Gets or sets the command to execute when an item is clicked and the IsItemClickEnabled property is true.

ItemHeight

Gets or sets the height of each item in the grid.

ItemsPanel

Gets the template that defines the panel that controls the layout of items.

OneRowModeEnabled

Gets or sets a value indicating whether only one row should be displayed.

StretchContentForSingleRow

Gets or sets a value indicating whether the control should stretch the content to fill at least one row.

Methods

CalculateItemWidth(Double)

Calculates the width of the grid items.

OnApplyTemplate()

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class.

PrepareContainerForItemOverride(DependencyObject, Object)

Prepares the specified element to display the specified item.

Applies to