WPF,这个事件触发器该怎么写
<Button Padding="30" Content="熊俊">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter" >
//这里该怎么写,使Content变为"张三"
</EventTrigger>
</Button.Triggers>
</Button>
问题:
一个事件触发器,当鼠标移到Button上时,使Content属性变为"张三",普通的属性触发器就不用了,我指的是用事件触发器。
------解决方案-------------------- <Button Name="huitest" Content="李四">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter">
<BeginStoryboard>
<Storyboard>
<StringAnimationUsingKeyFrames Storyboard.TargetProperty="Content" >
<DiscreteStringKeyFrame Value="张三" KeyTime="0:0:0" />
</StringAnimationUsingKeyFrames>