Baksteen.Avalonia.Tools.GridIndexer 0.1.0

dotnet add package Baksteen.Avalonia.Tools.GridIndexer --version 0.1.0                
NuGet\Install-Package Baksteen.Avalonia.Tools.GridIndexer -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Baksteen.Avalonia.Tools.GridIndexer" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Baksteen.Avalonia.Tools.GridIndexer --version 0.1.0                
#r "nuget: Baksteen.Avalonia.Tools.GridIndexer, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Baksteen.Avalonia.Tools.GridIndexer as a Cake Addin
#addin nuget:?package=Baksteen.Avalonia.Tools.GridIndexer&version=0.1.0

// Install Baksteen.Avalonia.Tools.GridIndexer as a Cake Tool
#tool nuget:?package=Baksteen.Avalonia.Tools.GridIndexer&version=0.1.0                

Baksteen.Avalonia.Tools.GridIndexer

This avalonia component automatically arranges components on a Grid. This is an Avalonia port (with minor changes) of Andrew KeepCoding's WinUI3 GridIndexer

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 cs file, add using statment using Baksteen.Avalonia.Tools.GridIndexer;
  • In your Window codebehind, 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:

<Grid ColumnDefinitions="*,*,*,*,*,*,*,*,*,*,*" RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
    <Label Foreground="Green" ex:GI.Column="0" ex:GI.Row="0">·A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    <Label ex:GI.Column="+1" ex:GI.Row="+1">→↓A</Label>
    
    <Label Foreground="Green" ex:GI.Column="4" ex:GI.Row="6">·B</Label>
    <Label ex:GI.Row="+1">↓B</Label>
    <Label ex:GI.Row="+1">↓B</Label>
    <Label ex:GI.Row="+1">↓B</Label>
    <Label ex:GI.Row="+1">↓B</Label>
    <Label ex:GI.Column="-1">←B</Label>
    <Label ex:GI.Column="-1">←B</Label>
    <Label ex:GI.Column="-1">←B</Label>
    <Label ex:GI.Row="-1">↑B</Label>
    <Label ex:GI.Row="-1">↑B</Label>
    <Label ex:GI.Row="-1">↑B</Label>
    <Label ex:GI.Row="-1">↑B</Label>
    <Label ex:GI.Column="+1">→B</Label>
    <Label ex:GI.Column="+1">→B</Label>
</Grid>

screenshot

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 130 2/16/2024

First release