2009-10-31 97 views
0

这是我的理解是这样的:默认图像样式

<Style TargetType="{x:Type Image}"> 
    <Setter Property="Margin" Value="0"/> 
    <Setter Property="Stretch" Value="None"/> 
    <Setter Property="HorizontalAlignment" Value="Center"/> 
    <Setter Property="VerticalAlignment" Value="Center"/> 
    <Setter Property="Cursor" Value="Help"/>  
</Style> 

会更改默认的图像设置为呈现在窗口中的每个图像。这不是这种情况吗?是否有图像的例外,因为它似乎与其他控件一起使用?

TIA

回答

1

要设置样式为你的实际需要设置X型:主要属性,像这样:

<Style x:Key="{x:Type Image}" TargetType="{x:Type Image}"> 
    <!-- setters here --> 
</Style> 
+0

谢谢德鲁! – Brad 2009-11-02 22:59:02

+0

很高兴我能帮到你。 ;) – 2009-11-02 23:01:12