{"id":21129519,"url":"https://github.com/guorg/gu.wpf.autogrid","last_synced_at":"2025-07-28T14:08:14.596Z","repository":{"id":40372968,"uuid":"62492442","full_name":"GuOrg/Gu.Wpf.AutoGrid","owner":"GuOrg","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-25T16:15:42.000Z","size":401,"stargazers_count":17,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T23:49:29.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-03T10:51:38.000Z","updated_at":"2025-01-06T09:27:16.000Z","dependencies_parsed_at":"2023-11-21T22:27:42.971Z","dependency_job_id":"5d9b09b3-763c-4abb-907c-c6ece6d9e42e","html_url":"https://github.com/GuOrg/Gu.Wpf.AutoGrid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GuOrg/Gu.Wpf.AutoGrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.AutoGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.AutoGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.AutoGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.AutoGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuOrg","download_url":"https://codeload.github.com/GuOrg/Gu.Wpf.AutoGrid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuOrg%2FGu.Wpf.AutoGrid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267527835,"owners_count":24102019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T05:24:43.436Z","updated_at":"2025-07-28T14:08:14.575Z","avatar_url":"https://github.com/GuOrg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gu.Wpf.AutoGrid\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Build status](https://ci.appveyor.com/api/projects/status/weieh2q82cc87ksr/branch/master?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-wpf-autogrid/branch/master)\n[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.AutoRowGrid.svg)](https://www.nuget.org/packages/Gu.Wpf.AutoRowGrid/)\n\n\nSmall prototype for a less noisy WPF grid. Perhaps useful when prototyping.\n\n\n# Grid\nIs a `MarkupExtension` that spits out a new vanilla WPF grid when `ProvideValue` is called.\n\n## ColumnDefinitions\n### Attribute style\n\n```xaml\n\u003cautoRowGrid:Grid ColumnDefinitions=\"Auto * 50\"\u003e\n    ...\n\u003c/autoRowGrid:Grid\u003e\n```\n### Element style\n\nThe designer may show a false negative error: `The attachable property 'ColumnDefinitions' was not found in type 'Grid'.`\nNot sure if #pragma can be used in xaml somehow.\n\n```xaml\n\u003cautoRowGrid:Grid AutoIncrementation=\"UseExplicitColumns\"\u003e\n    \u003cautoRowGrid:Grid.ColumnDefinitions\u003e\n        \u003cColumnDefinition Width=\"Auto\" MinWidth=\"70\" /\u003e\n        \u003cColumnDefinition Width=\"*\" MaxWidth=\"70\" /\u003e\n    \u003c/autoRowGrid:Grid.ColumnDefinitions\u003e\n\t ...\n\u003c/autoRowGrid:Grid\u003e\n```\n\n# Row \nIs just a `List\u003cUIElement\u003e` that insers its contents on the next row in the grid. This avoids specifying `Grid.Row=\"n\"`on multiple elements that are oin the same row and makes reordering trivial.\nNote that `Row`only exists in xaml for grouping elements on the same row. The idea is that it will making rearranging \u0026 reasoning about the grid easier.\nUsing a row the need for renumbering Grid.Row when moving things goes away.\n\n# AutoIncrementation\n\nBy default children of a `Row` get column index from their position:\n```xaml\n\u003cautoRowGrid:Row Name=\"first row\"\u003e\n    \u003cTextBlock Text=\"foo1\" /\u003e \u003c!--this gets Grid.Column=\"0\"--\u003e\n    \u003cTextBox Text=\"{Binding Value1}\" /\u003e \u003c!--this gets Grid.Column=\"1\"--\u003e\n\u003c/autoRowGrid:Row\u003e\n```\n\nIf you want to set expllicit columns use UseExplicitColumns\n```xaml\n\u003cautoRowGrid:Row AutoIncrementation=\"UseExplicitColumns\"\u003e\n    \u003cRectangle Grid.Column=\"0\" Fill=\"Aqua\" /\u003e\n    \u003cTextBlock Grid.Column=\"0\" Text=\"foo1\" /\u003e\n    \u003cTextBox Grid.Column=\"1\" Text=\"{Binding Value1}\" /\u003e\n\u003c/autoRowGrid:Row\u003e\n```\n\nCan also be set on a single `UIElement`: \n\n```xaml\n\u003cautoRowGrid:Row AutoIncrementation=\"AutoIncrement\"\u003e\n    \u003cRectangle Grid.Column=\"0\" Fill=\"Aqua\" autoRowGrid:AutoIncrement.AutoIncrementation=\"UseExplicitColumns\" /\u003e\n    \u003cTextBlock Text=\"foo3\" /\u003e\n    \u003cTextBox Text=\"{Binding Value3}\" /\u003e\n\u003c/autoRowGrid:Row\u003e\n```\n\nSetting this on an element excludes it from the count so following elements are not affected.\n\n## Defaults\nThe default for `AutoGrid` is `Increment` meaning children for `Row` get column index from position.\nThe default for `Row`and `Rows` is `Inherit` meaning they inherit incrementation from parent going all the way up to the `GridExtension`\n\n## LastRowFill\nIf the last row should fill remaining space of if a starsized row should be added after the last row.\n\n```xaml\n\u003cautoRowGrid:Grid ColumnDefinitions=\"Auto *\" LastRowFill=\"True\"\u003e\n    \u003cautoRowGrid:Row\u003e\n        \u003cTextBlock Text=\"foo1\" /\u003e\n        \u003cTextBox Text=\"{Binding Value1}\" /\u003e\n    \u003c/autoRowGrid:Row\u003e\n    \u003cautoRowGrid:Row AutoIncrementation=\"UseExplicitColumns\"\u003e\n        \u003cRectangle Grid.ColumnSpan=\"2\" Fill=\"RosyBrown\" /\u003e\n        \u003cTextBlock Grid.ColumnSpan=\"2\" HorizontalAlignment=\"Center\" Text=\"last\" /\u003e\n    \u003c/autoRowGrid:Row\u003e\n\u003c/autoRowGrid:Grid\u003e\n```\n\n## RowHeight\n\nSet `RowHeight` to specify height of generated rows. If set to star `LastRowFill` will have no effect.\n\nOr specify on individual rows like this:\n```xaml\n\u003cautoRowGrid:Grid ColumnDefinitions=\"* *\"\u003e\n    \u003cautoRowGrid:Row Height=\"25\"\u003e\n        \u003cRectangle Fill=\"Yellow\" /\u003e\n        \u003cRectangle Fill=\"Blue\" /\u003e\n    \u003c/autoRowGrid:Row\u003e\n\n    \u003cautoRowGrid:Row Height=\"40\"\u003e\n        \u003cRectangle Fill=\"Red\" /\u003e\n        \u003cRectangle Fill=\"Yellow\" /\u003e\n    \u003c/autoRowGrid:Row\u003e\n\u003c/autoRowGrid:Grid\u003e\n```\n\n# Sample xaml:\n\n```xaml\n\u003cWindow ...\n        xmlns:autoRowGrid=\"http://gu.se/AutoRowGrid\"\n        ...\u003e\n    \u003cautoRowGrid:Grid ColumnDefinitions=\"Auto * 50\"\u003e\n        \u003cTextBlock Grid.Row=\"0\" Grid.Column=\"0\" Text=\"foo1\" /\u003e\n        \u003cTextBox Grid.Row=\"0\" Grid.Column=\"1\"  Text=\"{Binding Value1}\" /\u003e\n\n        \u003cTextBlock Grid.Row=\"1\" Grid.Column=\"0\" Text=\"foo2\" /\u003e\n        \u003cTextBox Grid.Row=\"1\" Grid.Column=\"1\"  Text=\"{Binding Value2}\" /\u003e\n\n        \u003cRectangle Fill=\"Yellow\" Height=\"15\" Grid.Row=\"2\" Grid.Column=\"0\" Grid.ColumnSpan=\"3\" /\u003e\n\n        \u003cautoRowGrid:Row\u003e\n            \u003cTextBlock Text=\"foo3\" /\u003e\n            \u003cTextBox Text=\"{Binding Value3}\" /\u003e\n        \u003c/autoRowGrid:Row\u003e\n\n        \u003cautoRowGrid:Row\u003e\n            \u003cTextBlock Text=\"foo4\" /\u003e\n            \u003cTextBox Text=\"{Binding Value4}\" /\u003e\n        \u003c/autoRowGrid:Row\u003e\n\n        \u003cButton Grid.Row=\"4\" Grid.Column=\"2\" Content=\"foo5\" /\u003e\n\n        \u003cautoRowGrid:Row AutoIncrementation=\"UseExplicitColumns\"\u003e\n            \u003cRectangle Fill=\"Blue\" Height=\"15\" Grid.Row=\"2\" Grid.Column=\"1\" Grid.ColumnSpan=\"2\" /\u003e\n        \u003c/autoRowGrid:Row\u003e\n    \u003c/autoRowGrid:Grid\u003e\n\u003c/Window\u003e\n```\n\nProduces:\n\n![screenie](http://i.imgur.com/kAr50OX.png)\n\n# Sample with nesting:\n```xaml\n\u003cUserControl ...\n             xmlns:autoRowGrid=\"http://gu.se/AutoRowGrid\"\n             ...\u003e\n    \u003cautoRowGrid:Grid ColumnDefinitions=\"Auto *\"\u003e\n        \u003cautoRowGrid:Row Name=\"first row\"\u003e\n            \u003cTextBlock Text=\"foo1\" /\u003e\n            \u003cTextBox Text=\"{Binding Value1}\" /\u003e\n        \u003c/autoRowGrid:Row\u003e\n\n        \u003cautoRowGrid:Rows Name=\"a bunch of rows\"\u003e\n            \u003cautoRowGrid:Row\u003e\n                \u003cTextBlock Text=\"foo2\" /\u003e\n                \u003cTextBox Text=\"{Binding Value2}\" /\u003e\n            \u003c/autoRowGrid:Row\u003e\n\n            \u003cautoRowGrid:Row\u003e\n                \u003cTextBlock Text=\"foo3\" /\u003e\n                \u003cTextBox Text=\"{Binding Value3}\" /\u003e\n            \u003c/autoRowGrid:Row\u003e\n\n            \u003cautoRowGrid:Rows Name=\"a bunch of nested rows\"\u003e\n                \u003cautoRowGrid:Row\u003e\n                    \u003cTextBlock Text=\"foo4\" /\u003e\n                    \u003cTextBox Text=\"{Binding Value4}\" /\u003e\n                \u003c/autoRowGrid:Row\u003e\n\n                \u003cautoRowGrid:Row\u003e\n                    \u003cTextBlock Text=\"foo5\" /\u003e\n                    \u003cTextBox Text=\"{Binding Value5}\" /\u003e\n                \u003c/autoRowGrid:Row\u003e\n            \u003c/autoRowGrid:Rows\u003e\n\n            \u003cautoRowGrid:Row\u003e\n                \u003cTextBlock Text=\"foo6\" /\u003e\n                \u003cTextBox Text=\"{Binding Value6}\" /\u003e\n            \u003c/autoRowGrid:Row\u003e\n        \u003c/autoRowGrid:Rows\u003e\n\n        \u003cautoRowGrid:Row Name=\"last row\"\u003e\n            \u003cTextBlock Text=\"foo7\" /\u003e\n            \u003cTextBox Text=\"{Binding Value7}\" /\u003e\n        \u003c/autoRowGrid:Row\u003e\n    \u003c/autoRowGrid:Grid\u003e\n\u003c/UserControl\u003e\n```\n\nProduces:\n![screenie](http://i.imgur.com/GQifcug.png)\n\n\n# Limitation\nAs it is a markupextension using it like this will not work:\n\n```xaml\n\u003cGrid\u003e\n    \u003cGrid.RowDefinitions\u003e\n        \u003cRowDefinition /\u003e\n        \u003cRowDefinition /\u003e\n    \u003c/Grid.RowDefinitions\u003e\n\t\u003cautoRowGrid:Grid\u003e\n\t\t ...\n\t\u003c/autoRowGrid:Grid\u003e\n\u003c/Grid\u003e\n```\n\n![error](http://i.imgur.com/MkEn56s.png)\n\n\nNot sure if there is a nice workaround for this. Think the lib still has potential to be useful.\nA hacky way would be to set it as content for a lightweight element, probably good with a comment in xaml for stuff like this:\n\n```xaml\n\u003cGrid\u003e\n    \u003cGrid.RowDefinitions\u003e\n        \u003cRowDefinition /\u003e\n        \u003cRowDefinition /\u003e\n    \u003c/Grid.RowDefinitions\u003e\n    \u003cBorder\u003e\n        \u003c!--using a border to set the grid as content for here, the border does nothing but is a lightweight element--\u003e\n        \u003cautoRowGrid:Grid ColumnDefinitions=\"*\"\u003e\n            \u003cTextBlock Text=\"hej\" /\u003e\n        \u003c/autoRowGrid:Grid\u003e\n    \u003c/Border\u003e\n\u003c/Grid\u003e\n´´´\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguorg%2Fgu.wpf.autogrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguorg%2Fgu.wpf.autogrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguorg%2Fgu.wpf.autogrid/lists"}