How to set ViewBox background?

2019-02-17 10:47发布

问题:

I need to set the background of my System.Windows.Controls.Viewbox, but the property is missing.

How can I fix this problem?

回答1:

Put your viewbox inside a control that supports the background property:

<Border Background="Red">
   <ViewBox />
</Border>


回答2:

Put it in a Border and set its Background.