Oli*_*eng 3 silverlight user-controls button padding
见截图.边界青色边框是按钮,蓝色填充是矩形.我不能为我的生活弄清楚如何摆脱按钮中的填充.有没有办法将矩形定位在左上方,以便接触青色边框?

谢谢.
你有没有尝试设置Rectangle保证金0?
<Button x:Name="Button" BorderThickness="0" Margin="0" Padding="0" Width="96" Height="96">
<Rectangle Fill="Blue" Margin="0" Width="96" Height="96" />
</Button>
Run Code Online (Sandbox Code Playgroud)
编辑:填充必须来自按钮控制模板.尝试使用自定义模板:
<Style x:Key="MyButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Rectangle Fill="Blue" Margin="0" Width="96" Height="96" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Button x:Name="Button" BorderThickness="0" Margin="0" Padding="0"
Width="96" Height="96" Style="{StaticResource MyButton}" />
Run Code Online (Sandbox Code Playgroud)