Skip to content

Geeksltd/Zebble.Grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zebble.Grid

logo

A Zebble plugin that allow you to make grid in Zebble applications.

NuGet

A Grid is similar to ListView but instead of a single column it allows you to set the Columns (int) property.


Setup


Api Usage

The items in the data source will be rendered using the provided Template class. Each row will be filled first before moving to the next row.

When you add a child to a Grid, it will be added to its "current horizontal stack", until there are as many items in it as the "Columns" of the grid. Once reached, if you try to add another child view, it will first create a new row and then add the child to that row.

A grid is essentially a vertical stack of horizontal stacks.

The child objects within the grid can be anything. Also the width of each object can be different. In that sense the Zebble Grid is different from a HTML table.

<Grid Id="MyGrid" Width="200" Height="250" Columns="2">
       <TextView Text="Row 1, left cell" />
       <TextView Text="Row 1, right cell" />
       <TextView Text="Row 2, left cell" />
       <TextView Text="Row 2, right cell" />
       <TextView Text="Row 3, left cell" />
       <TextView Text="Row 3, right cell" />
       ...
</Grid>

Ensure full columns

If the number of items in the last row is less than the columns, it adds empty canvas cells to fill it up. This is useful for when you want to benefit from the automatic width allocation.

MyGrid.EnsureFullColumns();

Grid<TSource, TCellTemplate>

Just like ListView, Grid also comes in a generic form that is suitable for data binding scenarios. You can specify a data source and also an item templte so it can create the items for you automatically.

Properties

Property Type Android iOS Windows
Columns int x x x
ExactColumns bool x x x
DataSource List<TSource> x x x

Events

Event Type Android iOS Windows
EmptyTemplateChanged AsyncEvent x x x
Searching AsyncEvent x x x

Methods

Method Return Type Parameters Android iOS Windows
UpdateSource Task source -> IEnumerable<TSource> x x x

About

A grid is essentially a vertical stack of horizontal stacks that is created and managed automatically based on its children.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages