Windows Phone 7_EventTrigger
我正在使用 Windows Phone 7。当我使用 TextBlock 的 EventTrigger 时,如下所示:
<TextBlock Foreground="White" FontWeight="Bold" x:Name="txt" Text="199" Height="100">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="TextBlock.MouseMove" >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation AutoReverse="True" Duration="0:0:1"
From="1.0" RepeatBehavior="Forever"
Storyboard.TargetName="txt"
Storyboard.TargetProperty="Opacity"
To="0.0"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
如果我有 RoutedEvent="TextBlock.Loaded" 那没问题,但另一个事件(MouseMove、Click...)它将失败并显示错误“属性 TextBlock.MouseMove 值超出范围”。 有什么问题吗?
多谢。
I'm working with Windows Phone 7. When I use the EventTrigger for TextBlock as below:
<TextBlock Foreground="White" FontWeight="Bold" x:Name="txt" Text="199" Height="100">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="TextBlock.MouseMove" >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation AutoReverse="True" Duration="0:0:1"
From="1.0" RepeatBehavior="Forever"
Storyboard.TargetName="txt"
Storyboard.TargetProperty="Opacity"
To="0.0"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
If I have RoutedEvent="TextBlock.Loaded" that is no problem, but another event(MouseMove, Click...) it will fail with the error "Attribute TextBlock.MouseMove value is out of range".
What is the problem?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,“MouseMove”和“Click”不适用于手机,因为没有鼠标!
其次,您可能需要查看文档中的注释 MSDN:
Firstly "MouseMove" and "Click" don't apply on a phone as there is no mouse!
Secondly, you may want to check the remarks in the docs on MSDN: