{"id":16151617,"url":"https://github.com/jerry08/autogrid","last_synced_at":"2025-08-22T08:31:48.225Z","repository":{"id":123392480,"uuid":"470252684","full_name":"jerry08/AutoGrid","owner":"jerry08","description":"A magical replacement for the built in WPF Grid and StackPanel","archived":false,"fork":false,"pushed_at":"2022-03-15T17:01:03.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-02T00:42:02.830Z","etag":null,"topics":["autogrid","csharp","dotnet","dotnet-core","margin","panel","stackpanel","wpf","wpf-grid","wpftoolkit","xaml"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jerry08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-03-15T16:54:18.000Z","updated_at":"2023-03-13T09:52:53.000Z","dependencies_parsed_at":"2023-06-03T03:30:17.127Z","dependency_job_id":null,"html_url":"https://github.com/jerry08/AutoGrid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerry08%2FAutoGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerry08%2FAutoGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerry08%2FAutoGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerry08%2FAutoGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerry08","download_url":"https://codeload.github.com/jerry08/AutoGrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230575850,"owners_count":18247484,"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","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":["autogrid","csharp","dotnet","dotnet-core","margin","panel","stackpanel","wpf","wpf-grid","wpftoolkit","xaml"],"created_at":"2024-10-10T00:58:14.923Z","updated_at":"2024-12-20T11:09:17.150Z","avatar_url":"https://github.com/jerry08.png","language":"C#","readme":"WpfToolkit\n==================\n\nA magical replacement for the built in WPF Grid and StackPanel.\n\n\u003e **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.\n\n## Installation\n\nTo add WpfToolkit to your WPF project, all you have to do is install it from NuGet:\n\n```\nInstall-Package AutoGrid\n```\n\nUsage Examples\n--------------\n\n**AutoGrid**\n\nIn order to get\n\n![Form Image](v2_gridlayout.png)\u003cbr/\u003e\n[Sourced from the awesome WpfTutorials](http://wpftutorial.net/GridLayout.html)\n\nYou would typically write XAML that looked like\n\n```xml\n\u003cGrid\u003e\n    \u003cGrid.RowDefinitions\u003e\n        \u003cRowDefinition Height=\"Auto\" /\u003e\n        \u003cRowDefinition Height=\"Auto\" /\u003e\n        \u003cRowDefinition Height=\"*\" /\u003e\n        \u003cRowDefinition Height=\"28\" /\u003e\n    \u003c/Grid.RowDefinitions\u003e\n    \u003cGrid.ColumnDefinitions\u003e\n        \u003cColumnDefinition Width=\"Auto\" /\u003e\n        \u003cColumnDefinition Width=\"200\" /\u003e\n    \u003c/Grid.ColumnDefinitions\u003e\n    \u003cLabel Grid.Row=\"0\" Grid.Column=\"0\" Content=\"Name:\"/\u003e\n    \u003cLabel Grid.Row=\"1\" Grid.Column=\"0\" Content=\"E-Mail:\"/\u003e\n    \u003cLabel Grid.Row=\"2\" Grid.Column=\"0\" Content=\"Comment:\"/\u003e\n    \u003cTextBox Grid.Column=\"1\" Grid.Row=\"0\" Margin=\"3\" /\u003e\n    \u003cTextBox Grid.Column=\"1\" Grid.Row=\"1\" Margin=\"3\" /\u003e\n    \u003cTextBox Grid.Column=\"1\" Grid.Row=\"2\" Margin=\"3\" /\u003e\n    \u003cButton Grid.Column=\"1\" Grid.Row=\"3\" HorizontalAlignment=\"Right\" \n            MinWidth=\"80\" Margin=\"3\" Content=\"Send\"  /\u003e\n\u003c/Grid\u003e\n```\n\nYou can simply write\n\n```xml\n\u003cst:AutoGrid Rows=\"Auto,Auto,*,28\" Columns=\"Auto,200\" Orientation=\"Vertical\"\u003e\n    \u003cLabel Content=\"Name:\"/\u003e\n    \u003cLabel Content=\"E-Mail:\"/\u003e\n    \u003cLabel Content=\"Comment:\"/\u003e\n    \u003cLabel /\u003e \u003c!-- Empty placeholder for lower left corner --\u003e\n    \n    \u003cTextBox Margin=\"3\" /\u003e\n    \u003cTextBox Margin=\"3\" /\u003e\n    \u003cTextBox Margin=\"3\" /\u003e\n    \u003cButton HorizontalAlignment=\"Right\" \n            MinWidth=\"80\" Margin=\"3\" Content=\"Send\"  /\u003e\n\u003c/st:AutoGrid\u003e\n```\n\nI 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.\n\n```xml\n\u003cst:AutoGrid Rows=\"Auto,Auto,*,28\" Columns=\"Auto,200\" ChildMargin=\"3\"\u003e\n    \u003cLabel Content=\"Name:\"/\u003e\n    \u003cTextBox/\u003e\n\n    \u003cLabel Content=\"E-Mail:\"/\u003e\n    \u003cTextBox/\u003e\n\n    \u003cLabel Content=\"Comment:\"/\u003e\n    \u003cTextBox/\u003e\n\n    \u003cLabel /\u003e\u003c!-- Empty placeholder for lower left corner --\u003e\n    \u003cButton HorizontalAlignment=\"Right\" \n            MinWidth=\"80\" Content=\"Send\"  /\u003e\n\u003c/st:AutoGrid\u003e\n```\n\n**StackPanel**\n\nThe 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. \n\nAlso, 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.\n\n```xml\n\u003cst:StackPanel Orientation=\"Horizontal\" MarginBetweenChildren=\"10\" Margin=\"10\"\u003e\n    \u003cButton Content=\"Info\" HorizontalAlignment=\"Left\" st:StackPanel.Fill=\"Fill\"/\u003e\n    \u003cButton Content=\"Cancel\"/\u003e\n    \u003cButton Content=\"Save\"/\u003e\n\u003c/st:StackPanel\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerry08%2Fautogrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerry08%2Fautogrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerry08%2Fautogrid/lists"}