将您的路径放在视图框中,使其缩放到按钮的大小。例如
<Grid>
<Button Height="23">
<Viewbox>
<Path Stroke="White" StrokeThickness="3">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="20,20" />
<LineGeometry StartPoint="20,0" EndPoint="0,20" />
</GeometryGroup>
</Path.Data>
</Path>
</Viewbox>
</Button>
</Grid>
或者
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal">
<Viewbox>
<Path StrokeEndLineCap="Triangle" StrokeStartLineCap="Triangle"
Stroke="White" StrokeThickness="3">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="20,20" />
<LineGeometry StartPoint="20,0" EndPoint="0,20" />
</GeometryGroup>
</Path.Data>
</Path>
</Viewbox>
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="Press me"/>
</StackPanel>
</Button>
</Grid>