【发布时间】:2014-05-02 11:37:27
【问题描述】:
我有这样的代码
<Viewbox Grid.Row="1">
<controls:Tile Name="tileInvoice" Click="tileInvoice_Click" VerticalAlignment="Stretch" ToolTip="{x:Static resx:omniLang.Invoice}">
<controls:Tile.Background>
<ImageBrush ImageSource="Resources/invoice.png" Stretch="Uniform"/>
</controls:Tile.Background>
<TextBlock Name="headerInvoice" Text="{x:Static resx:omniLang.Invoice}" FontSize="22" Foreground="Black" FontWeight="Bold" VerticalAlignment="Center" Margin="0,100,0,0" />
</controls:Tile>
</Viewbox>
我喜欢使用纯色作为背景,仍然使用 png 图像。我已经没有想法了。我应该使用 VisualBrush 来实现这一点吗?
【问题讨论】:
-
非常相似的问题...stackoverflow.com/a/14085305/1706610
标签: c# wpf background tile