wpf 如何设置ViewBox背景?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19875898/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 10:01:43 来源:igfitidea点击:
How to set ViewBox background?
提问by Nick
I need to set the background of my System.Windows.Controls.Viewbox, but the property is missing.
我需要设置我的背景System.Windows.Controls.Viewbox,但缺少该属性。
How can I fix this problem?
我该如何解决这个问题?
回答by Alberto
Put your viewbox inside a control that supports the background property:
将您的 viewbox 放在支持 background 属性的控件中:
<Border Background="Red">
<ViewBox />
</Border>
回答by Nikhil Agrawal
Put it in a Borderand set its Background.
将其放入 aBorder并设置其Background.

