开发者

Windows Phone 7_EventTrigger

I'm working with Windows Phone 7. When I use the EventTrigger for TextBlock as below:

<TextBlock Foreground="White" Fon开发者_Go百科tWeight="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.


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:

The only supported value in Silverlight is Loaded/FrameworkElement.LoadedEvent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜