如何将PathGeometry作为图标添加到按钮/radbutton的样式中?
例如,在我拥有的资源中:
<PathGeometry x:Key="HomeIconData">F1 M 22,19L 24,19L 24,57L 22,57L 22,19 Z M 26,57L 26,19.0001L 53.9999,19.0001L 53.9999,57L 26,57 Z M 30,24L 30,27L 50,27L 50,24L 30,24 Z M 30,32L 30,35L 33,35L 33,32L 30,32 Z M 36,32L 36,35L 49,35L 49,32L 36,32 Z M 30,40L 30,43L 33,43L 33,40L 30,40 Z M 36,40L 36,43L 48,43L 48,40L 36,40 Z M 30,48L 30,51L 33,51L 33,48L 30,48 Z M 36,48L 36,51L 50,51L 50,48L 36,48 Z</PathGeometry>
使用Path,我将其添加到样式中:
<Grid Margin="0,30,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="36" Width="41">
<Path HorizontalAlignment="Center" Data="{Binding Source={StaticResource path1}, Path=Data}" Fill="#FFFFFFFF" Height="27" Stretch="Fill" Width="28.167" VerticalAlignment="Bottom" />
</Grid>
如何对PathGeometry执行相同操作?感谢
这应该有效:
<Path Data="{StaticResource HomeIconData}" ... />