Control no longer using WinUI 2 styles when you apply a custom style to it? Here's how to fix it in XAML
So you've applied your own style to a Button , TextBox , ContentDialog or any other UWP control only to find that the control has reverted to the in-built UWP styles - no longer are WinUI styles being used for the control. Gone are the rounded corners and back are various fluent design lighting effects and 3D button effects common in older versions of Windows 10. You check your custom styles and can't find any reason why the control(s) look like this and you followed the instructions on how to apply the WinUI styles to your app. Well, that's because it's not your fault - this is actually normal behaviour. Read on to see why and the quick and easy fix for it. Why this happens This actually happens due to the default behaviour of UWP. In fact, if you've used WPF (Windows Presentation Foundation), it had the same behaviour. What happens is that whenever you apply your own styles to controls, any properties not defined by the style are inherited by the built-in styles,...