This requires creating the Window chrome (borders) completely from scratch. For an example, including code, see WPF Custom Chrome Library on CodePlex.
How to override WindowStyle in WPF
-
29-06-2022 - |
Question
Can anyone show me how to override the WindowStyle in WPF application? preferablly in XAML.
I'm writing an application and I want to customize the top bar of the window. I know I can change it with , but I'm not able to do any customization with it.
Here is a picture of what I'm thinking. From:
To:
I want to be able to change background color and put my own icons on it.
Solution 2
OTHER TIPS
If you are using .NET 4.5, you can access the WindowChrome
property of your window. If you are using .NET 3.5 or .NET 4.0, you will need to use a separate library, such as Microsoft.Windows.Shell.dll
.
If you do not care about the system minimize animation, you can set ResizeMode
to NoResize
and WindowStyle
to None
then draw your custom border.