Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielchalmers/wpfwindowplacement
Win32 WindowPlacement helpers for WPF
https://github.com/danielchalmers/wpfwindowplacement
attached-properties helpers win32 windowplacement wpf
Last synced: 4 days ago
JSON representation
Win32 WindowPlacement helpers for WPF
- Host: GitHub
- URL: https://github.com/danielchalmers/wpfwindowplacement
- Owner: danielchalmers
- License: mit
- Created: 2017-09-17T20:31:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-02T19:05:56.000Z (about 1 year ago)
- Last Synced: 2025-01-18T20:12:45.617Z (6 days ago)
- Topics: attached-properties, helpers, win32, windowplacement, wpf
- Language: C#
- Homepage:
- Size: 61.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# WpfWindowPlacement [![NuGet](https://img.shields.io/nuget/v/WpfWindowPlacement.svg)](https://www.nuget.org/packages/WpfWindowPlacement)
[WINDOWPLACEMENT](https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-windowplacement) helpers for WPF.
## Example
Define a [`WindowPlacement`](WpfWindowPlacement/WindowPlacement.cs) property.
```csharp
using WpfWindowPlacement;
WindowPlacement MyPlacement { get; set; }
```Now use it in the XAML attached property or code-behind functions.
### XAML
```xaml
xmlns:wp="clr-namespace:WpfWindowPlacement;assembly=WpfWindowPlacement"wp:WindowPlacementProperties.Placement="{Binding MyPlacement}"
```### Code-behind
```csharp
using WpfWindowPlacement;// Get window size, position, and state, and assign to MyPlacement.
MyPlacement = WindowPlacementFunctions.GetPlacement(this);// Set window size, position, and state to the value of MyPlacement.
WindowPlacementFunctions.SetPlacement(this, MyPlacement);
```## License
[MIT License](LICENSE.md)