This is a sample WPF project named "WindowChromeMultiscreen" that demonstrates the usage of the WindowChrome
style to customize the title bar in a WPF window.
Report Bug
·
Request Feature
Table of Contents
The project showcases how to use the WindowChrome
class in WPF to create a custom title bar that matches the style of
the application.
It provides a multi-screen functionality by utilizing native methods to retrieve information about the connected monitors.
Additionally, it incorporates following features:
- Customized title bar using WindowChrome style
- Multi-screen support using native methods
- Dependency injection for enhanced modularity
- Window chrome with title bar buttons and styles
- AppState to remember window size and position using the Jot library
- Visual Studio 17.5+
- WPF workload
- .NET 7.0
To get started with the WindowChromeMultiscreen project, follow these steps:
-
Clone the repository:
git clone https://github.com/sygmond/WindowChromeMultiscreen.git
-
Open the solution file,
WindowChromeMultiscreen.sln
, in Visual Studio. -
Build the solution to restore NuGet packages and compile the project.
-
Run the application to see the sample window with a customized title bar and multi-screen support.
- Implement native methods to retrieve information about connected monitors.
- Enable multi-screen support in the application.
- Introduce dependency injection to enhance modularity and testability of the application.
- Use the appropriate DI container to manage dependencies.
- Customize the window chrome to match the application's style.
- Add minimize, maximize/restore, and close buttons to the title bar.
- Implement AppState class to remember and restore window size and position.
- Utilize the Jot library for serialization and deserialization of the window state.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Make sure to follow the existing code style and conventions.
This project is licensed under the MIT License. Feel free to modify and use the code as per the license terms.
Special thanks to the author of the Jot library for providing a convenient solution for serialization and deserialization of the window state. The Jot library greatly simplifies the process of storing and retrieving the window size and position, enhancing the functionality of this project.
- Jot Library: GitHub