Sta*_*eff 3 .net c# wpf xaml canvas
我ResourceDictionary对所有图标都使用 a ,如下所示:
<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>
Run Code Online (Sandbox Code Playgroud)
和实际的 XAML:
<Button Content="{StaticResource Icon.Refresh}"
Height="40"
Width="40" />
Run Code Online (Sandbox Code Playgroud)
这工作正常,因为我的大多数按钮都是这个尺寸。但是当我想在较小的按钮上使用它时,它会溢出按钮:
<Button Content="{StaticResource Icon.Refresh}"
Height="30"
Width="30" />
Run Code Online (Sandbox Code Playgroud)

有没有办法设置 a 的大小StaticResource或任何其他聪明的事情可以做?
| 归档时间: |
|
| 查看次数: |
1865 次 |
| 最近记录: |