Microsoft® Surface® Live Stream Code Sample

ive Stream enables businesses to engage their customers face-to-face using the most recent and relevant Twitter™, Flickr®, and RSS newsfeeds.

C# (5.9 MB)
 
 
 
 
 
4.3 Star
(4)
6,652 times
Add to favorites
4/19/2011
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
<s:SurfaceUserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:s="http://schemas.microsoft.com/surface/2008"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
                      xmlns:props="clr-namespace:LiveStream.Properties"
                      x:Class="LiveStream.Controls.River" d:DesignWidth="1024" d:DesignHeight="768">
  <Grid Background="Transparent">
    <VisualStateManager.VisualStateGroups>
      <VisualStateGroup x:Name="LoadingStates">
        <VisualState x:Name="IsLoadingState"/>
        <VisualState x:Name="NotLoadingState">
          <Storyboard>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="_loader">
              <SplineDoubleKeyFrame KeyTime="0:0:1" Value="181" KeySpline="0,0,1,0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_loader">
              <SplineDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
              <SplineDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_scatterView">
              <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
              <SplineDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
        </VisualState>
      </VisualStateGroup>
      <VisualStateGroup x:Name="DirectionStates">
        <VisualState x:Name="MovingRightState"/>
        <VisualState x:Name="MovingLeftState">
          <Storyboard>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="_orientedControls">
              <SplineDoubleKeyFrame KeyTime="0" Value="180"/>
            </DoubleAnimationUsingKeyFrames>
          </Storyboard>
        </VisualState>
      </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <s:ScatterView x:Name="_scatterView" x:FieldModifier="private" ItemContainerStyle="{DynamicResource FlippingScatterViewItemStyle}" Opacity="0"/>
    <Grid x:Name="_orientedControls" RenderTransformOrigin="0.5,0.5">
      <Grid.RenderTransform>
        <TransformGroup>
          <ScaleTransform/>
          <SkewTransform/>
          <RotateTransform/>
          <TranslateTransform/>
        </TransformGroup>
      </Grid.RenderTransform>
      <Grid x:Name="_loader" Height="50" HorizontalAlignment="Right" VerticalAlignment="Center" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5">
        <Grid.RenderTransform>
          <TransformGroup>
            <ScaleTransform/>
            <SkewTransform/>
            <RotateTransform/>
            <TranslateTransform/>
          </TransformGroup>
        </Grid.RenderTransform>
        <Border CornerRadius="25,0,0,25" BorderBrush="Black" BorderThickness="3" Opacity="0.8" >
          <Border.Effect>
            <BlurEffect Radius="15"/>
          </Border.Effect>
        </Border>
        <Border CornerRadius="25,0,0,25" Background="White" Opacity="0.8" />
        <TextBlock Text="{x:Static props:Resources.Loading}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="40,0" Foreground="Black" FontWeight="SemiBold" />
      </Grid>
    </Grid>
  </Grid>
</s:SurfaceUserControl>