How to setUp Button Background image either theme is dark or white

后端 未结 2 936
死守一世寂寞
死守一世寂寞 2020-12-22 08:17

I use below code to set up button background image using a png file with white image.

ImageBrush brush = new ImageBrush();    

brush.ImageSource = new Bitma         


        
2条回答
  •  鱼传尺愫
    2020-12-22 08:32

    http://www.mendzapp.com/archives/196

    This article explains how to detect the selected theme on the phone (dark or white) and how to use this to change the background of controls. In your case when using an image, I'd suggest creating a second image and load the correct one depending on the selected theme on the phone.

    Hope this helps! :)

提交回复
热议问题