Window corner

A quite complex C# WPF project I’m working on is riddled with various performance issues. After shaving off component after component, trying to locate why everything in the application felt sluggish, I arrived at AllowsTransparency="True" and Background="Transparent. The offending code looked like this:

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    ...
    WindowStyle="None"
    AllowsTransparency="True"
    Background="Transparent"
    WindowState="Normal"
    x:Name="mainWindow">

The window’s background is transparent to be able to create custom rounded corners (see the above picture with and without the effect). Maybe fancy in somebody’s mind, but apparently it makes the window render in software rather than hardware, which explains why it slows to a crawl. I’m not convinced that prettier window corners is worth a significant performance penalty.

Read more on: