A Better Browsing Experience: Listing 2.

XAML for the animated ProgressBar.

<VisualStateManager.VisualStateGroups>
  <VisualStateGroup x:Name="LoadingStates">
    <VisualState x:Name="Loading">
      <Storyboard>
        <ObjectAnimationUsingKeyFrames 
          Storyboard.TargetProperty="(UIElement.Visibility)"
          Storyboard.TargetName="GD_Progress">
          <DiscreteObjectKeyFrame KeyTime="0">
            <DiscreteObjectKeyFrame.Value>
              <Visibility>Visible</Visibility>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames 
          Storyboard.TargetProperty="(ProgressBar.IsIndeterminate)"
          Storyboard.TargetName="progressBar">
          <DiscreteObjectKeyFrame KeyTime="0">
            <DiscreteObjectKeyFrame.Value>
              <System:Boolean>True</System:Boolean>
            </DiscreteObjectKeyFrame.Value>
          </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
      </Storyboard>
    </VisualState>
    <VisualState x:Name="Loaded" />
  </VisualStateGroup>
</VisualStateManager.VisualStateGroups>

About the Author

Nick Randolph runs Built to Roam, a consulting company that specializes in training, mentoring and assisting other companies build mobile applications. With a heritage in rich client applications for both the desktop and a variety of mobile platforms, Nick currently presents, writes and educates on the Windows Phone platform.

comments powered by Disqus

Featured

Subscribe on YouTube