{"id":15090999,"url":"https://github.com/littoma/winformsmarkup","last_synced_at":"2026-01-30T16:02:07.833Z","repository":{"id":247943078,"uuid":"827199776","full_name":"LITTOMA/WinFormsMarkup","owner":"LITTOMA","description":"WinForms Markup is an experimental project for modern, fluent API in C# WinForms development.","archived":false,"fork":false,"pushed_at":"2024-07-11T15:39:03.000Z","size":167,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T10:15:43.125Z","etag":null,"topics":["csharp","dotnet","winforms"],"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/LITTOMA.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":"2024-07-11T07:33:12.000Z","updated_at":"2024-07-11T15:39:06.000Z","dependencies_parsed_at":"2024-07-11T13:11:45.308Z","dependency_job_id":"eaa84c27-4d38-4ef2-aba8-e4895d14c3cb","html_url":"https://github.com/LITTOMA/WinFormsMarkup","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"84585156f2cfc51291d48026bce4d1df76efbd3a"},"previous_names":["littoma/winformsmarkup"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LITTOMA%2FWinFormsMarkup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LITTOMA%2FWinFormsMarkup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LITTOMA%2FWinFormsMarkup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LITTOMA%2FWinFormsMarkup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LITTOMA","download_url":"https://codeload.github.com/LITTOMA/WinFormsMarkup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937834,"owners_count":20535127,"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":["csharp","dotnet","winforms"],"created_at":"2024-09-25T10:35:03.442Z","updated_at":"2026-01-30T16:02:02.806Z","avatar_url":"https://github.com/LITTOMA.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WinForms Markup\n\nWinForms Markup is an experimental project designed to provide a modern, declarative, and fluent approach to building C# WinForms applications. This library enhances existing WinForms controls using extension methods, allowing developers to quickly construct complex user interfaces with chained calls.\n\n## Features\n\n- **Modern WinForms Development**: Write WinForms apps with a clean, fluent API.\n- **Automatic Code Generation**: Includes pre-generated extension methods for controls in `System.Windows.Forms`.\n- **Improved Readability**: Simplify your WinForms code for better readability and maintainability.\n- **Strong Typing and IntelliSense**: Maintain C# strong typing and enjoy full IntelliSense support.\n- **Support for Common WinForms Features**: Easily manage layout, event handling, and more.\n\n## Installation\nInstall the `WinFormsMarkup` package from NuGet:\n``` shell\ndotnet add package WinFormsMarkup --version 1.0.0\n```\n\n## Usage\n\nHere is a simple example demonstrating how to use WinForms Markup to build a user interface:\n\n```csharp\nusing System;\nusing System.Windows.Forms;\nusing WinFormsMarkup;\n\npublic class Program\n{\n    [STAThread]\n    static void Main()\n    {\n        Application.EnableVisualStyles();\n        Application.SetCompatibleTextRenderingDefault(false);\n        Application.Run(BuildMainForm());\n    }\n\n    private static Form BuildMainForm()\n    {\n        int clickCount = 0;\n        return new Form()\n            .Text(\"WinForms Markup\")\n            .Size(800, 600)\n            .FormBorderStyle(FormBorderStyle.Sizable)\n            .AddControls(\n                new Label()\n                    .Text(\"Hello, WinFormsMarkup!\")\n                    .Anchor(AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right)\n                    .Location(10, 10)\n                    .Size(780, 30)\n                    .Assign(out var label),\n                new Button()\n                    .Text(\"Click Me!\")\n                    .Location((800 - 100) / 2, 40)\n                    .Size(100, 30)\n                    .OnClick((sender, e) =\u003e label.Text = $\"Clicked {++clickCount} times\")\n                    .Assign(out var button)\n            )\n            .OnResize((sender, e) =\u003e button.Location = new Point(((Form)sender).ClientSize.Width / 2 - button.Width / 2, button.Location.Y))\n            .Assign(out var mainForm);\n    }\n}\n```\n\n## Hot Reload\n\nWinForms Markup supports hot reload, allowing you to make changes to your WinForms application while it is running. This feature is useful for quickly iterating on your UI design without restarting the application.\n\n**Note**: Hot reload is currently experimental and only supports single-form applications.\n\nTo enable hot reload, use `HotReloadApplicationContext` instead of `ApplicationContext` when running your application:\n\n```csharp\nApplication.Run(new HotReloadApplicationContext(BuildMainForm));\n\nstatic Form BuildMainForm()\n{\n    // Build your form here\n}\n```\n\nWhen you run your application, you can now make changes to your form-building function and see the updates reflected in the running application.\n\n## Extension Methods\n\nWinForms Markup includes pre-generated extension methods for common WinForms controls, such as:\n\n- **Property Setting**: Methods for setting common control properties\n- **Event Handling**: Methods for handling common events\n- **Layout Management**: Methods for managing control layout\n- **Control Addition**: Methods for adding controls to containers\n- **Style Setting**: Methods for setting control appearance\n- **Resource Management**: Simplified usage of icons and images\n\n## Generating Additional Extensions\n\nIf you need to generate extension methods for custom controls or other assemblies, you can use the WinForms Markup Generator. The generator processes a .NET assembly and generates extension methods for all public classes that inherit from `Control`.\n\n### Usage\n\nTo use the WinForms Markup Generator, run the executable with the input and output file arguments. The input file should be a .NET assembly, and the output directory will contain the generated C# source files.\n\n```\nwmgen.exe [input file].dll [output directory]\n```\n\n### Example\n\n```\nwmgen.exe MyWinFormsControlLib.dll GeneratedExtensions\n```\n\nThis will generate C# source files with extension methods for each control found in `MyWinFormsControlLib.dll` and save them in the `GeneratedExtensions` directory.\n\n## Contributing\n\nContributions are welcome! If you have any suggestions or improvements, feel free to submit a pull request or open an issue.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Disclaimer\n\nThis project is experimental and primarily aimed at exploring and improving the WinForms development experience. Use it with caution in production environments and thoroughly test its stability and compatibility.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittoma%2Fwinformsmarkup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittoma%2Fwinformsmarkup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittoma%2Fwinformsmarkup/lists"}