Colorful bitmap icons in UWP and Uno Platform

Uncategorized

4 years ago

The BitmapIcon control makes it simple to add icons in UWP and Uno Platform apps. By default, the icons are monochromatic and adapt to light and dark theme automatically. However, Fluent Design System is now getting more and more colorful so it makes sense to add a splash of color to some iconography in your app as well. It turns out this is very easy to do! You can use the ShowAsMonochrome property, which by default set to true. Setting it to false disables this behavior and keeps your bitmap colors intact. For the following simple sample:

We get:

Colorful icon on UWP

And of course the same across all Uno Platform targets! Let's see WebAssembly for example:

Colorful icon on WASM

If you want to try out this sample on your devices, check out the sample on GitHub!