C# Class UniformGridForUWP.UniformGrid

Provides a way to arrange content in a grid where all the cells in the grid have the same size.
Inheritance: Windows.UI.Xaml.Controls.Panel
Mostrar archivo Open project: rickapps/UWP-UniformGrid-Control

Public Properties

Property Type Description
ColumnsProperty Windows.UI.Xaml.DependencyProperty
FirstColumnProperty Windows.UI.Xaml.DependencyProperty
RowsProperty Windows.UI.Xaml.DependencyProperty

Public Methods

Method Description
UniformGrid ( ) : System

Initializes a new instance of the UniformGrid.

Protected Methods

Method Description
ArrangeOverride ( Size finalSize ) : Size

Defines the layout of the System.Windows.Controls.Primitives.UniformGrid by distributing space evenly among all of the child elements.

Private Methods

Method Description
MeasureOverride ( Size constraint ) : Size
OnFirstColumnChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Check that the offset is positive. This seems to be the only check in the WPF uniform grid. Might also make the offset be less than the number of items included in the grid.

OnRowsColumnsChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Validity check on row or column. For now, just check that it is positive. This code could be much simplified.

UpdateComputedValues ( ) : void

If no row count or column count is specified, use the smallest square number that will contain all the items as our dimensions. Otherwise, calculate the number of rows or columns needed to contain all items.

Method Details

ArrangeOverride() protected method

Defines the layout of the System.Windows.Controls.Primitives.UniformGrid by distributing space evenly among all of the child elements.
protected ArrangeOverride ( Size finalSize ) : Size
finalSize Windows.Foundation.Size The System.Windows.Size of the area for the grid to use.
return Windows.Foundation.Size

UniformGrid() public method

Initializes a new instance of the UniformGrid.
public UniformGrid ( ) : System
return System

Property Details

ColumnsProperty public_oe static_oe property

public static DependencyProperty,Windows.UI.Xaml ColumnsProperty
return Windows.UI.Xaml.DependencyProperty

FirstColumnProperty public_oe static_oe property

public static DependencyProperty,Windows.UI.Xaml FirstColumnProperty
return Windows.UI.Xaml.DependencyProperty

RowsProperty public_oe static_oe property

public static DependencyProperty,Windows.UI.Xaml RowsProperty
return Windows.UI.Xaml.DependencyProperty