我为我的 Button 创建了自定义样式,但它不再可点击,如何保留按钮的默认点击属性。
<Style x:Key="customStyle" TargetType="Button">
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="0,0,1,1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Canvas x:Name="ButtonCanvas" Width="171" Height="144">
<Image x:Name="ButtonImage" Width="171" Height="144" Source="{Binding thumbnail}"/>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>