How to set ViewBox background?

Nick picture Nick · Nov 9, 2013 · Viewed 7.6k times · Source

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

How can I fix this problem?

Answer

Alberto picture Alberto · Nov 9, 2013

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

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