2010-08-31 59 views

回答

1

您可以在不透明度屬性上使用帶有DoubleAnimationUsingKeyFrames的情節提要(這隻會隱藏網格,不會摺疊它)。

0

添加以下代碼:

<Window.Resources> 
    <Storyboard x:Key="HideGridSB"> 
     <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)"> 
      <SplineDoubleKeyFrame KeyTime="00:00:05.000000" Value="0"/> 
     </DoubleAnimationUsingKeyFrames> 
    </Storyboard> 
</Window.Resources> 

<Window.Triggers> 
    <EventTrigger RoutedEvent="FrameworkElement.Loaded"> 
     <BeginStoryboard Storyboard="{StaticResource HideGridSB}"/> 
    </EventTrigger> 
</Window.Triggers>