0
我有这样的代码,它的工作原理:如何在WPF网格设置样式
<Grid Height="Auto" Width="Auto" HorizontalAlignment="Center"
Margin="15,50,0,25" Grid.Row="8" MouseLeftButtonDown="buttonFermaNAO_Click">
<Image Margin="0,10,0,10"
Width="206" Height="46"
HorizontalAlignment="Center">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Source" Value="./Resources/Tasto_esegui_senza scritta_ROLL_OFF.png"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Source" Value="./Resources/Tasto start_senza scritta_Roll_ON.png"/>
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<Label HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Roboto-Bold"
FontSize="25" Foreground="White" >Ferma NAO</Label>
</Grid>
有了这个代码,当我将鼠标移动到图像被改变的图像,这是确定,但在该中心图像我有标签,我将鼠标移动到标签上,图像没有被改变,也没有确定。
我虽然如果有可能删除图像代码,并在网格设置风格,这可能吗?
这是我现在有结果:
,如果我把鼠标移动到按钮上我有这样的:
您的解决方案:) – bircastri