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.

Was it helpful?

Solution 2

This requires creating the Window chrome (borders) completely from scratch. For an example, including code, see WPF Custom Chrome Library on CodePlex.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top