Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/AvaloniaUI/AvaloniaAutoGrid


https://github.com/AvaloniaUI/AvaloniaAutoGrid

Last synced: 26 days ago
JSON representation

Awesome Lists containing this project

README

        

Avalonia Auto
============

A flexible, easy to configure replacement for the standard Grid control. Ported from [WPF AutoGrid](https://github.com/carbonrobot/wpf-autogrid)

Now Available on NuGet! https://www.nuget.org/packages/Avalonia.AutoGrid/

AutoGrid lets you reduce the amount of xaml when using grids for layout by allowing you to define rows and columns as simple properties and alleviating you from having to explicitly specify the row and column a child control belongs to.

Partially based on work at http://rachel53461.wordpress.com/2011/09/17/wpf-grids-rowcolumn-count-properties/

#### Standard WPF Grid

```xml













```

#### AutoGrid (Same output as above)

```xml




```

Notice how in the example above we didn't need to specify the row and column that each element belonged to; AutoGrid automatically figures out what row and column we wanted based on our configuration of the grid. AutoGrid uses a row first or column first arrangement for its auto layout which can changed by setting the Orientation property.

Don't want AutoGrid to position elements automatically? **OK**

Explicit assignment of columns and rows still works too. This allows you to upgrade more easily. Most of time you can mix both without much trouble, but take care that this is not always the case.

#### Defining a even spaced 6x6 grid with a default margin of 10 for all cells

```xml

```

#### Grid with relative based column widths and fixed row height

```xml

```

#### Orientation="Horizontal" (default)

In this example, labels will fall in the first column, and textboxes will be in the second column

```xml




```

#### Orientation="Vertical"

In this example, labels will fall in the first row, and textboxes will be in the second row

```xml




```

#### Support for collapsed children

Collapsed elements will be removed from the flow, hidden elements will still occupy space in the grid

```xml




```