dotnet / dotnet/wpf

Visual styles are off by default

Open
#179 0 comments 10 reactions 0 assignees View on GitHub
API suggestion
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

The experience when creating a new WPF app and showing a message box is that we get the old-school UI because visual styles are off by default:
![image](https://user-images.githubusercontent.com/11444821/50056931-d3e68200-0163-11e9-9570-5e47c2228a94.png)

compare that to the equivalent code from a new Windows Forms app:
![image](https://user-images.githubusercontent.com/11444821/50056921-b5808680-0163-11e9-9876-5e844874c905.png)

It has always bothered me that the default experience when using WPF is *worse* than for Windows Forms even though WPF is the newer technology. It gives a really bad impression and makes WPF seem unpolished.

Not only that, but it seems like the best workaround is adding some XML in an extra file: https://stackoverflow.com/questions/5289328/wpf-messagebox-window-style

In my opinion the best case scenario would be that this would just work by default, without any code required to opt-in; if anything, there would be an opt-out. However if compatibility is a concern, then there should be a new API introduced to enable this similar to Windows Forms' `Application.EnableVisualStyles` (perhaps a property on `Application`) which would be enabled for all new created projects by including this in the template, just like Windows Forms does.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.