如何让内容填满XAML中的整个按钮?

如何让内容填满XAML中的整个按钮?,xaml,uwp,blend,Xaml,Uwp,Blend,我有一个UWP应用程序,我希望路径是按钮的内容。到目前为止,我的情况如下: <Style TargetType="Button" x:Key="arrow"> <Setter Property="Content"> <Setter.Value> <Path Height="10" Width="10" Stretch="Uniform" Fill="Black" Data="F1 M 92.362,56.1133C

我有一个UWP应用程序,我希望路径是按钮的内容。到目前为止,我的情况如下:

<Style TargetType="Button" x:Key="arrow">
   <Setter Property="Content">
      <Setter.Value>
          <Path Height="10" Width="10" Stretch="Uniform" Fill="Black" Data="F1 M 92.362,56.1133C 93.8282,57.8717 92.9765,60.7721 90.4336,60.7721L 80.461,60.7721L 80.461,103.953C 80.461,105.441 79.22,106.682 77.7318,106.682L 55.6016,106.682C 54.1133,106.682 52.8718,105.441 52.8718,103.953L 52.8718,60.7721L 42.8997,60.7721C 40.3575,60.7721 39.5052,57.8717 40.972,56.1133L 64.7376,27.5612C 65.3184,26.8627 66.0052,26.6081 66.6667,26.6536C 67.3282,26.6081 68.0131,26.8627 68.5964,27.5612L 92.362,56.1133 Z M 66.6667,0C 103.484,0 133.333,29.8476 133.333,66.6667C 133.333,103.486 103.484,133.333 66.6667,133.333C 29.8483,133.333 0,103.486 0,66.6667C 0,29.8476 29.8483,0 66.6667,0 Z M 66.6667,122.667C 97.5938,122.667 122.667,97.5938 122.667,66.6667C 122.667,35.739 97.5938,10.6667 66.6667,10.6667C 35.7389,10.6667 10.6667,35.739 10.6667,66.6667C 10.6667,97.5938 35.7389,122.667 66.6667,122.667 Z "/>
      </Setter.Value>
   </Setter>
</Style>

和按钮:


但是,路径没有显示。进一步的调查显示,路径在较小的尺寸时被切断,并在较大的尺寸上作为内容工作。我怀疑这可能与某种内容填充有关。如何使路径填满按钮而不是被切断?

您自己已经解决了它-这是一个填充问题(按钮有一个默认值-只需将其更改为0)。我试过这样做,应该可以:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
  <Grid.Resources>
    <Style TargetType="Button" x:Key="arrow">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Content">
            <Setter.Value>
                <Path Height="10" Width="10" Stretch="Uniform" Fill="Black" Data="F1 M 92.362,56.1133C 93.8282,57.8717 92.9765,60.7721 90.4336,60.7721L 80.461,60.7721L 80.461,103.953C 80.461,105.441 79.22,106.682 77.7318,106.682L 55.6016,106.682C 54.1133,106.682 52.8718,105.441 52.8718,103.953L 52.8718,60.7721L 42.8997,60.7721C 40.3575,60.7721 39.5052,57.8717 40.972,56.1133L 64.7376,27.5612C 65.3184,26.8627 66.0052,26.6081 66.6667,26.6536C 67.3282,26.6081 68.0131,26.8627 68.5964,27.5612L 92.362,56.1133 Z M 66.6667,0C 103.484,0 133.333,29.8476 133.333,66.6667C 133.333,103.486 103.484,133.333 66.6667,133.333C 29.8483,133.333 0,103.486 0,66.6667C 0,29.8476 29.8483,0 66.6667,0 Z M 66.6667,122.667C 97.5938,122.667 122.667,97.5938 122.667,66.6667C 122.667,35.739 97.5938,10.6667 66.6667,10.6667C 35.7389,10.6667 10.6667,35.739 10.6667,66.6667C 10.6667,97.5938 35.7389,122.667 66.6667,122.667 Z "/>
            </Setter.Value>
        </Setter>
    </Style>
  </Grid.Resources>
    <Button HorizontalAlignment="Center" Height="14" Width="14" Style="{StaticResource arrow}"/>
</Grid>