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

https://github.com/sourcechord/gridextra

Custom panel controls for WPF/UWP.
https://github.com/sourcechord/gridextra

grid responsive uwp wpf xaml

Last synced: about 1 month ago
JSON representation

Custom panel controls for WPF/UWP.

Awesome Lists containing this project

README

        

# GridExtra
GridExtra is a custom panel library for WPF/UWP.

* ResponsiveGrid
* Custom Panel class that provides bootstrap like grid system.
* Grid system
* switch layout with window width.
* XS(<768px), SM(<992px), MD(<1200px), LG(1200px<=)
* 12 columns across the page.(customizable with MaxDivision property)
* GridEx
* Helper class that defines usefull attached properties for Grid panel.
* WrapPanelEx
* Helper class that provide adaptive layout for WrapPanel.

## install
*Nuget Package*
```
Install-Package GridExtra
```
https://www.nuget.org/packages/GridExtra/

### Preparation
Add xmlns to xaml code.

#### For WPF
```xml
xmlns:ge="clr-namespace:SourceChord.GridExtra;assembly=GridExtra.Wpf"
```

#### For UWP
```xml
xmlns:ge="using:SourceChord.GridExtra"
```

## Usage
### ResponsiveGrid
ResponsiveGrid provides the grid layout system that is similar to Bootstrap framework.

![demo](./docs/ResponsiveGrid/demo.gif)

#### Example
```xml



<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="LightGray" />
<Setter Property="Height" Value="60" />








```
*extra small device(~768px)*
![extra small device](./docs/ResponsiveGrid/capture1.png)

*small device(~992px)*
![small device](./docs/ResponsiveGrid/capture2.png)

#### Properties

##### Dependency Properties
|Property Name|Type|Description|
|-----|-----|-----|
|MaxDivision|int|Gets or sets a value that determines grid divisions.|
|BreakPoints|BreakPoints class||
|ShowGridLines|int|Gets or sets a value that indicates whether grid column's lines are visible within this ResponsiveGrid. |

##### Attached Properties

|Property Name|Type|Description|
|-----|-----|-----|
|XS
SM
MD
LG
|int|Gets or sets a value that determines grid columns for XS(extra small), SM(small), MD(medium), LG(large) devices.|
|XS_Offset
SM_Offset
MD_Offset
LG_Offset
|int|Gets or sets a value that determines grid columns offset for XS(extra small), SM(small), MD(medium), LG(large) devices.|
|XS_Push
SM_Push
MD_Push
LG_Push
|int|Gets or sets a value that moves columns to right from the original position.|
|XS_Pull
SM_Pull
MD_Pull
LG_Pull
|int|Gets or sets a value that moves columns to left from the original position.|

##### Compared to bootstrap

|bootstrap|ResponsiveGrid|
|-----|-----|
|col-xs
col-sm
col-md
col-lg
|XS
SM
MD
LG
|
|col-xs-offset
col-sm-offset
col-md-offset
col-lg-offset
|XS_Offset
SM_Offset
MD_Offset
LG_Offset
|
|col-xs-push
col-sm-push
col-md-push
col-lg-push
|XS_Push
SM_Push
MD_Push
LG_Push
|
|col-xs-pull
col-sm-pull
col-md-pull
col-lg-pull
|XS_Pull
SM_Pull
MD_Pull
LG_Pull
|
|visibility-xs, visibility-sm,…
hidden-xs, hidden-sm,...|(T.B.D.)|

#### attention
ResponsiveGrid is not suitable for ItemsPanel, because it isn't implemented VirtualizingPanel class.

If you use ResponsiveGrid in ListBox as ItemsPanel.
Your ListBox become to not virtualize items of ListBox.

### GridEx
GridEx is Helper class for defining Grid properties.

![demo](./docs/GridEx/demo.gif)

#### Example1 (Row/Column Definition)
```xml



```

![Example1](./docs/GridEx/example1.png)

##### Row/Column Definition with Min/Max size

```xml



```
`ge:GridEx.ColumnDefinition="50, *(50-200), 2*(80-), 2*(-300)"` is similar to below definition.

```xml






```

#### Example2 (Area Definition)
`Area` property provides the way of defineing Row/Column/RowSpan/ColumnSpan.

```xml




```

![Example2](./docs/GridEx/example2.png)

#### Example3 (Named Template Area)

`TemplateArea` provides named grid areas, like CSS Grid Layout Module Level 1.
`TemplateArea` property makes row/column definition. And, define region's name.

Children of Grid can be placed with region's name, that is defined by `TemplateArea` property.

```xml







```

![Example3](./docs/GridEx/example3.png)

Row devision is defined by line feed or `/`.
* line feed
* `\n`(.cs)
* `
`(xaml)
* `/`

```xml

```

#### Example4 (Named Template Area, working with RowDefinition/ColumnDefintion)

```xml







```

![Example4](./docs/GridEx/example4.png)

##### Attached Properties(for Grid)

|Property Name|Type|Description|
|-----|-----|-----|
|RowDefinition|string|Sets a value that determines row definition of Grid.|
|ColumnDefinition|string|Sets a value that determines column definition of Grid.|
|TemplateArea|string|Sets a definition of grid devision and area names. |

##### Attached Properties(for Grid children)

|Property Name|Type|Description|
|-----|-----|-----|
|Area|string|Sets a value that determines Row, Column, RowSpan, ColumnSpan properties.|
|AreaName|string|Sets a name of regions for item's belong.(use with `TemplateArea` property)|

#### Example5 (Auto fill children)

![demo2](./docs/GridEx/demo2.gif)

##### Attached Properties(for Grid)
|Property Name|Type|Description|
|-----|-----|-----|
|AutoFillChildren|string|Gets or sets a value that indicates whether the Grid arranges its children to each cell.|
|AutoFillOrientation|string|Sets a value that determines auto fill orientation.|
##### Attached Properties(for Grid children)
|Property Name|Type|Description|
|-----|-----|-----|
|AutoFillSpan|string|Sets a value that determines cell span value that is used during AutoFill process.|

```xml





```
![Example5](./docs/GridEx/example5.png)

##### AutoFillChildren with Hidden/Collapsed items

```xml








```
![Example5_1](./docs/GridEx/example5_1.png)

##### AutoFillChildren with pinned items

```xml







```

![Example5_2](./docs/GridEx/example5_2.png)

### WrapPanelEx **(WPF Only)**
WrapPanelEx is Helper class that provide adaptive layout for WrapPanel.

![demo](./docs/WrapPanelEx/demo.gif)

#### Example1
WrapPanelEx.AdaptiveLayout property makes WrapPanel into UWP Community Toolkit's [AdaptiveGridView](https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/controls/AdaptiveGridView) like layout.

```xml
















```

## Lisence
[MIT](LICENSE)