{"id":20624861,"url":"https://github.com/thoemmi/stickywindows","last_synced_at":"2025-07-09T07:34:29.614Z","repository":{"id":138005768,"uuid":"82341725","full_name":"thoemmi/StickyWindows","owner":"thoemmi","description":"Make your top-level windows stick when moved or resized.","archived":false,"fork":false,"pushed_at":"2018-10-19T22:59:55.000Z","size":119,"stargazers_count":29,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-04-15T15:04:46.664Z","etag":null,"topics":["sticky","windows","winforms","wpf"],"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/thoemmi.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":"2017-02-17T21:59:17.000Z","updated_at":"2025-03-10T13:09:59.000Z","dependencies_parsed_at":"2023-06-03T02:00:28.437Z","dependency_job_id":null,"html_url":"https://github.com/thoemmi/StickyWindows","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoemmi%2FStickyWindows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoemmi%2FStickyWindows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoemmi%2FStickyWindows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoemmi%2FStickyWindows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoemmi","download_url":"https://codeload.github.com/thoemmi/StickyWindows/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094932,"owners_count":21211837,"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":["sticky","windows","winforms","wpf"],"created_at":"2024-11-16T13:07:09.099Z","updated_at":"2025-04-15T15:04:51.731Z","avatar_url":"https://github.com/thoemmi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StickyWindows\n\nThis library helps creating window applications where the windows can both stick to\nscreen borders and to each other.\n\nThe code originates from the Codeproject article\n[Sticky Windows - How to make your (top-level) forms to stick one to the other or to the screen](https://www.codeproject.com/Articles/6045/Sticky-Windows-How-to-make-your-top-level-forms-to)\nby Corneliu Tusnea. He never published a NuGet package, so I asked for his permission\nto both create a repository at GiutHub and publish it as a NuGet package.\n\n## Build status and NuGet packages\n\n|                   | Stable                                                         | Pre-release                                              |\n|-------------------|----------------------------------------------------------------|----------------------------------------------------------|\n| AppVeyor          | [![Build status][appveyor-master-badge]][appveyor-master-link] | [![Build status][appveyor-dev-badge]][appveyor-dev-link] |\n| StickyWindows     | [![NuGet][nuget-master-badge]][nuget-master-link]              | [![NuGet][nuget-dev-badge]][nuget-dev-link]              |\n| StickyWindows.Wpf | [![NuGet][nuget-master-wpf-badge]][nuget-master-wpf-link]      | [![NuGet][nuget-dev-wpf-badge]][nuget-dev-wpf-link]      |\n\n[appveyor-master-badge]: https://ci.appveyor.com/api/projects/status/ynjy63xrlvrrmseg/branch/master?svg=true\n[appveyor-master-link]:  https://ci.appveyor.com/project/thoemmi/stickywindows/branch/master\n[appveyor-dev-badge]:    https://ci.appveyor.com/api/projects/status/ynjy63xrlvrrmseg/branch/develop?svg=true\n[appveyor-dev-link]:     https://ci.appveyor.com/project/thoemmi/stickywindows/branch/develop\n[nuget-master-badge]:    https://img.shields.io/nuget/v/StickyWindows.svg\n[nuget-master-link]:     https://www.nuget.org/packages/StickyWindows\n[nuget-dev-badge]:       https://img.shields.io/nuget/vpre/StickyWindows.svg\n[nuget-dev-link]:        https://www.nuget.org/packages/StickyWindows\n[nuget-master-wpf-badge]:  https://img.shields.io/nuget/v/StickyWindows.WPF.svg\n[nuget-master-wpf-link]:   https://www.nuget.org/packages/StickyWindows.WPF\n[nuget-dev-wpf-badge]:     https://img.shields.io/nuget/vpre/StickyWindows.WPF.svg\n[nuget-dev-wpf-link]:      https://www.nuget.org/packages/StickyWindows.WPF\n\n## Usage\n\nActually there are two libraries published: one is for WinForms applications,\nand the other one for WPF applications. The latter bases on the WinForms package\nthough. but this shouldn't be an issue as that the WinForms library is part of the\n.NET framework and as such is always available.\n\n### WinForms\n\nFor WinForms application, use the\n[**StickyWindow**](https://www.nuget.org/packages/StickyWindows)\npackage.\n\nIn the **constructor** of your form add this line:\n\n```csharp\nnew StickyWindows.StickyWindow(this);\n```\n\nIf you want to deviate from the default settings, `StickyWindow` provides following\nboolean properties (which are all `true` by default:\n\n* `StickOnMove`\u003cbr\u003eAllows the form to try to stick when the form is moved.\n* `StickOnResize`\u003cbr\u003eAllows the form to try to stick when the form is resized.\n* `StickToOther`\u003cbr\u003eAllows the form to try to stick to other stick-able forms.\n* `StickToScreen`\u003cbr\u003eAllows the form to try to stick to the screen margins.\n\n### WPF\n\nFor WinForms application, use the\n[**StickyWindow.WPF**](https://www.nuget.org/packages/StickyWindows.WPF)\npackage.\n\n\nYou have two options to make your windows \"sticky\":\n\n1. Subscribe to your window's `Loaded` event and call the extension method\n   `CreateStickyWindow` in the handler:\n   ```csharp\n   _stickyWindow = this.CreateStickyWindow();\n   ```\n\n2. Use the `StickyWindowBehavior` in your XAML code (which I think is more elegant\n   than option 1):\n   ```xml\n    \u003cWindow\n      x:Class=\"WpfTest.Window2\"\n      xmlns:i=\"http://schemas.microsoft.com/expression/2010/interactivity\"\n      xmlns:wpf=\"clr-namespace:StickyWindows.WPF;assembly=StickyWindows.WPF\"\n      ...\u003e\n      \u003ci:Interaction.Behaviors\u003e\n        \u003cwpf:StickyWindowBehavior /\u003e\n      \u003c/i:Interaction.Behaviors\u003e\n      ...\n    \u003c/Window\u003e\n   ```\n\nBoth options support the same properties as the WinForms implementation.\n\n\u003e Please note that **StickyWindows.WPF** requires **System.Windows.Interactivity**,\n\u003e which is neither part of the library nor a dependency of the NuGet package. The point\n\u003e is, there's no official NuGet package for **System.Windows.Interactivity** by Microsoft.\n\u003e I decided against delivering this library as part of **StickyWindows.WPF** as it may\n\u003e conflict with different versions in other libraries you may be using potentially.\n\n## Version History\n\n### v0.3 (not released yet)\n\n* Fixed the MaximumSize and MinimumSize issue reported in #5 (Thanks to @lucky3)\n* Added [SourceLink](https://github.com/dotnet/sourcelink) support\n\n### v0.2 (11-Apr-2017)\n\n* Fixed strange margin when running on Windows 10 ([#1](https://github.com/thoemmi/StickyWindows/issues/1))\n\n### v0.1 (10-Mar-2017)\n\n* Inital Release\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoemmi%2Fstickywindows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoemmi%2Fstickywindows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoemmi%2Fstickywindows/lists"}