템플릿을 사용하는 단추가 있습니다. 내 템플릿에는 올바르게 작동하는 모든 것이 있습니다. 내 버튼이 모든 이미지와 텍스트와 함께 올바르게 표시됩니다. 하지만 내 버튼에 마우스를 올리면됩니다. 나는 스타일과 스타일 트리거 마우스를 시도해 보았지만 어느 것도 효과가 없었다. 누군가 내 버튼 템플릿에 마우스를 가져 가면 아래에 나타나는 효과를 얻을 수 있다고 말해 줄 수 있습니까?XAML 단추 호버 효과
<Button Command="{Binding AppToolbarViewModel.RunToolAction, Source={StaticResource ViewModelLocator}}" CommandParameter="{Binding XamlURI}" ToolTip="{Binding ToolToolTip}"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Cursor="Hand">
<Button.Template>
<ControlTemplate>
<StackPanel Orientation="Horizontal">
<Grid>
<Label Content="" Style="{StaticResource FontAwesomeLabel}" />
<Label Content="{Binding ImageURI}" Style="{StaticResource FontAwesomeLabel}" FontSize="20" Margin="10,10,0,0" Foreground="GhostWhite" />
</Grid>
<Label Content="{Binding ToolName}" Style="{StaticResource ButtonLabel}" />
</StackPanel>
</ControlTemplate>
</Button.Template>
</Button>
답장을 보내 주셔서 감사합니다. 기본 효과 인 마우스가 단추 위에있을 때 변경할 배경을 찾고 있습니다. 내가 이해하는 한, 당신은 ControlTemplate을 사용할 때 그 효과를 잃어 버린다. 나는 그것을 되찾고 싶다. 가능하다면 완전한 XAML 솔루션을 원합니다. –
VisualStateManager 클래스는 당신이 찾고있는 클래스라고 생각합니다. 100 % XAML이 아니지만 코드가 미미한 것은 아닙니다. http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager(v=vs.110).aspx –