0

I use a static resource for opacity of various controls in my uwp page, resource named 'BgOpacity2'. When I use a constant value like 0.8, it works. But it shows error as 'Invalid value for type Double..', when I use 'x:Bind' as shown below. How to handle this?

enter image description here

Mg Bhadurudeen
  • 1,140
  • 1
  • 12
  • 24

1 Answers1

1

You can't set bind for x:Double like the above. That is wrong xaml syntax. In general, if you want to modify static resource value you could modify it in the code behind like following.

Application.Current.Resources["BgOpacity2"] = 0.8;

You could also create a Setting class that contain such property. for more detail, please refer this case reply.

Nico Zhu
  • 32,367
  • 2
  • 15
  • 36