2013-04-29 33 views

回答

0

XAML

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> 

    <!-- Data will be loaded in GridView --> 
    <GridView /> 

    <!-- Black layer with progress ring --> 
    <Border x:Name="border" BorderBrush="Black" BorderThickness="1" Opacity="0.95" Background="Black" Visibility="Collapsed"> 
     <ProgressRing HorizontalAlignment="Center" VerticalAlignment="Center" IsActive="True" Width="100" Height="100" /> 
    </Border> 

    <!-- Visual state will switch black layer and GridView --> 
    <VisualStateManager.VisualStateGroups> 
     <VisualStateGroup> 
      <VisualState x:Name="Normal" /> 
      <VisualState x:Name="Dark"> 
       <Storyboard> 
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="border"> 
         <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> 
        </ObjectAnimationUsingKeyFrames> 
       </Storyboard> 
      </VisualState> 
     </VisualStateGroup> 
    </VisualStateManager.VisualStateGroups> 
</Grid> 

C#

protected override void OnNavigatedTo(NavigationEventArgs e) 
{ 
    VisualStateManager.GoToState(this, "Dark", true); 

    //TODO: Load Data 

    VisualStateManager.GoToState(this, "Normal", true); 
} 
+0

它完美:)謝謝 – 2013-04-29 16:36:03

+0

歡迎您:) – Xyroid 2013-04-29 16:41:07