Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpmikkers/baksteen.avalonia.tools.gridindexer
This avalonia component automatically arranges components on a Grid
https://github.com/jpmikkers/baksteen.avalonia.tools.gridindexer
arrange autoarrange avalonia grid gridindexer xaml
Last synced: 9 days ago
JSON representation
This avalonia component automatically arranges components on a Grid
- Host: GitHub
- URL: https://github.com/jpmikkers/baksteen.avalonia.tools.gridindexer
- Owner: jpmikkers
- License: mit
- Created: 2024-02-16T14:23:11.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-16T16:00:27.000Z (9 months ago)
- Last Synced: 2024-11-03T04:05:44.296Z (11 days ago)
- Topics: arrange, autoarrange, avalonia, grid, gridindexer, xaml
- Language: C#
- Homepage:
- Size: 207 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Baksteen.Avalonia.Tools.GridIndexer
This avalonia component automatically arranges components on a Grid. It enables putting absolute and relative positioning hints on components in a Grid, which will save a lot of time when you have to rearrange or add things to the grid.Note: This is an Avalonia port (with minor changes) of [Andrew KeepCoding's](https://github.com/AndrewKeepCoding) WinUI3 [GridIndexer](https://github.com/AndrewKeepCoding/AK.Toolkit)
## How to use
- Add nuget package Baksteen.Avalonia.Tools.GridIndexer
- In your Window xaml (containing the Grid you want to autoindex), add a namespace like so `xmlns:ex="using:Baksteen.Avalonia.Tools.GridIndexer"`
- In your Window csharp file, add using statement `using Baksteen.Avalonia.Tools.GridIndexer;`
- In your Window csharp file, after `InitializeComponent()` add a call `GridIndexer.RunGridIndexer(this);`
- on your Grid child components you can now add absolute or relative positioning properties, e.g. `ex:GI.Row="2"`, `ex:GI.Row="+1"`, `ex:GI.Column="4"`, `ex:GI.Column="-1"`## Example
The following XAML results in the grid below:
```xaml·A
→↓A
→↓A
→↓A
→↓A
→↓A
→↓A
→↓A
→↓A
→↓A
→↓A
·B
↓B
↓B
↓B
↓B
←B
←B
←B
↑B
↑B
↑B
↑B
→B
→B```
![image](https://github.com/jpmikkers/Baksteen.Avalonia.Tools.GridIndexer/assets/10578746/fba02f9b-10d1-4b29-8924-42788d6722a1)