【发布时间】:2014-03-26 09:55:11
【问题描述】:
我的所有图标都使用ResourceDictionary,如下所示:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas x:Key="Icon.Refresh"
Width="32" Height="32"
Clip="F1 M 0,0L 32,0L 32,32L 0,32L 0,0">
<Path Width="28" Height="28"
Canvas.Left="2" Canvas.Top="2"
Stretch="Fill"
Data="..." />
</Canvas>
</ResourceDictionary>
以及实际的 XAML:
<Button Content="{StaticResource Icon.Refresh}"
Height="40"
Width="40" />
这很好用,因为我的大多数按钮都是这个大小。但是当我想在较小的按钮上使用它时,它会溢出按钮:
<Button Content="{StaticResource Icon.Refresh}"
Height="30"
Width="30" />
有没有办法设置StaticResource 的大小或任何其他聪明的做法?
【问题讨论】: