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

https://github.com/jerry08/autogrid

A magical replacement for the built in WPF Grid and StackPanel
https://github.com/jerry08/autogrid

autogrid csharp dotnet dotnet-core margin panel stackpanel wpf wpf-grid wpftoolkit xaml

Last synced: 4 months ago
JSON representation

A magical replacement for the built in WPF Grid and StackPanel

Awesome Lists containing this project

README

          

WpfToolkit
==================

A magical replacement for the built in WPF Grid and StackPanel.

> **NOTE:** I'm in the process of renaming this project from AutoGrid to WpfToolkit. This is because I plan to add more useful features to this package beyond just AutoGrid.

## Installation

To add WpfToolkit to your WPF project, all you have to do is install it from NuGet:

```
Install-Package AutoGrid
```

Usage Examples
--------------

**AutoGrid**

In order to get

![Form Image](v2_gridlayout.png)

[Sourced from the awesome WpfTutorials](http://wpftutorial.net/GridLayout.html)

You would typically write XAML that looked like

```xml

















```

You can simply write

```xml









```

I personally like to put my `Label`s with the element they are labeling. So just remove the `Orientation` which defaults to `Horizontal` and rearrange the elements. You can also pull the common margin up, defining it only once.

```xml





```

**StackPanel**

The built in StackPanel control has always been frustrating to use. When you have a `TextBlock` that has a lot of text, it is impossible to wrap that text without setting an explicit width. Also, a StackPanel does not fill its container.

Also, I've always wanted a simple container which would apply a margin but only between child elements. This allows me to control the margin of the parent and the spacing between each child separately and cleanly.

```xml



```