How can I bind a background color in WPF/XAML?

后端 未结 8 1805
情话喂你
情话喂你 2020-12-05 04:01

What do I have to change to the following code so that the background is red, neither of the 2 ways I tried worked:


(source: deviantsart.com)

8条回答
  •  星月不相逢
    2020-12-05 04:54

    I figured this out, it was just a naming conflict issue: if you use TheBackground instead of Background it works as posted in the first example. The property Background was interfering with the Window property background.

提交回复
热议问题