Supporting Windows themes
In the modern tech ecosystem, one of the most common features included in every app or device is support for light and dark themes. This feature has become increasingly important not only to accommodate personal preferences but also to better support accessibility scenarios. Additionally, when you're using applications on battery-powered devices (such as a tablet or a phone), dark themes have a less significant impact on battery life, since they reduce the number of pixels that the screen must render.
Windows provides built-in support for themes and the user can set their preferences through the Settings app. Additionally, Windows provides a high-contrast theme, which is dedicated to people who have visual impairments.
By default, WinUI applications automatically follow the Windows theme, thanks to the built-in support provided by all the WinUI controls. If you add any standard control to a page, you will notice how its look and feel will automatically...