【发布时间】:2012-08-10 13:49:30
【问题描述】:
如何在网格容器的背景中存储和显示一条线? 我必须为每个资源字典设置背景。
<Style TargetType="{x:Type Grid}">
<Setter Property="Background">
<Setter.Value>
<!--here I had to display a vertical line at bottom,
which goes over the whole window -->
</Setter.Value>
</Setter>
</Style>
或:
<Style TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<!-- here I had to display a vertical line at bottom,
which goes over the whole window and set the background color-->
</Setter.Value>
</Setter>
</Style>
问题是我需要应用程序的每个窗口中的红色页脚。我使用ResourceDictionary 进行造型。我不能使用图片,因为我必须在运行时/为每个应用程序设置颜色。
【问题讨论】:
-
你能展示一些 XAML 并解释一下你想要做什么吗?你想要这条线在哪里?垂直的?水平的?一条线?多行?以某种方式与网格对齐?
-
我有一个网格,它覆盖了我的网格的标准样式。问题是,我必须为窗口的每个应用程序的整个背景设置颜色,并绘制一条垂直线,该线设置在底部并具有我的代码的窗口宽度,请参阅我的帖子...我已经编辑了
-
是否有一个选项可以将窗口的背景设置为一种颜色并设置在行上?网格的想法不是一个好主意,我认为^^