2010-08-18 5 views
1

내가 이벤트가 발생을로드 할 때, XamlParseException가 발생하는 등이벤트 트리거는

<Grid x:Name="ContentGrid" Grid.Row="1" Background="Red" Height="100"> 
    <Grid.Triggers> 
     <EventTrigger RoutedEvent="Loaded"> 
      <BeginStoryboard> 
       <Storyboard> 
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Opacity"> 
         <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> 
         <SplineDoubleKeyFrame KeyTime="00:00:10" Value="1"/> 
        </DoubleAnimationUsingKeyFrames> 
       </Storyboard> 
      </BeginStoryboard> 
     </EventTrigger> 
    </Grid.Triggers> 
</Grid> 

하지만 내 윈도우 폰 7 실버 라이트 응용 프로그램에 약간의 트리거가 작동하지 않습니다. 나는 조금 봤지만 아무 것도 발견하지 못했습니다.

솔루션을 찾을 수있는 아이디어가 있습니까? 감사합니다. . Grid.Opacity에 그리드

  • 변경에 대한 참고 문헌 TargetProperty로 Grid.Loaded
  • 추가 targetName을에

    • RoutedEvent을 변경 :
  • 답변

    5

    나는 코드 약간 변경

    아래 코드를보십시오 :

    <Grid x:Name="ContentGrid" Grid.Row="1" Background="Red" Height="100"> 
         <Grid.Triggers> 
          <EventTrigger RoutedEvent="Grid.Loaded"> 
           <BeginStoryboard> 
            <Storyboard> 
             <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="Grid.Opacity"> 
              <SplineDoubleKeyFrame KeyTim> 
              <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> 
              <SplineDoubleKeyFrame KeyTime="00:00:10" Value="1"/> 
             </DoubleAnimationUsingKeyFrames> 
            </Storyboard> 
           </BeginStoryboard> 
          </EventTrigger> 
         </Grid.Triggers> 
    </Grid> 
    
    +0

    감사합니다, 잘 작동합니다 :) –

    관련 문제