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,654 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"
                      xmlns:controls="clr-namespace:LiveStream.Controls"
                      xmlns:helpers="clr-namespace:LiveStream.Helpers"
                      xmlns:props="clr-namespace:LiveStream.Properties"
                      xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" mc:Ignorable="d" x:Class="LiveStream.Controls.RiverContent.LargeTweet"
                      xmlns:feeditems="clr-namespace:FeedProcessor.FeedItems;assembly=FeedProcessor"
                      d:DesignWidth="350" d:DesignHeight="235">
  <s:SurfaceUserControl.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/LiveStream;component/Resources/Converters.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <feeditems:StatusFeedItem x:Key="DesignData"
                                Date="6/21/2010 10:23:00 AM"
                                Author="MSSurface"
                                Status="If you have a 140 character Q on the Microsoft Surface SDK, Luis is now on the channel to answer in 140 characters! #Surface #WPF #XNA ^eh" />
    </ResourceDictionary>
  </s:SurfaceUserControl.Resources>
  <Grid d:DataContext="{DynamicResource DesignData}">
    <Border Background="{DynamicResource ForegroundBrush}"/>
    <Grid Margin="5">
      <Border CornerRadius="35,0,0,0" >
      	<Border.Background>
      		<SolidColorBrush Color="#D8000000" />
      	</Border.Background>
      </Border>
      <Grid Margin="20,10,25,20">
        <Viewbox x:Name="_scalingContentContainer" VerticalAlignment="Top" />
        <Border x:Name="_fixedContentContainer">
          <StackPanel x:Name="_contentRoot">
            <TextBlock Text="{x:Static props:Resources.Tweet}" FontSize="36" FontFamily="{DynamicResource HeaderFont}" />
            <Grid Margin="0,10,0,0">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
              </Grid.ColumnDefinitions>
              <TextBlock Text="{Binding Author}" FontSize="14" />
              <TextBlock Grid.Column="1" Text="{Binding Date, Converter={StaticResource RelativeTimeConverter}}" FontSize="10" VerticalAlignment="Bottom" Opacity=".5" TextAlignment="Right" >
                <i:Interaction.Behaviors>
                  <helpers:RefreshBindingBehavior PropertyToRefresh="Text"/>
                </i:Interaction.Behaviors>
              </TextBlock>
            </Grid>
            <Grid Margin="0,10,0,0">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
              </Grid.ColumnDefinitions>
              <controls:ImageLoader Style="{DynamicResource ImageLoaderStyle}" UriSource="{Binding AvatarUri}" Width="48" Height="48" VerticalAlignment="Top" Stretch="UniformToFill" Label="{x:Static props:Resources.Avatar}" ClipToBounds="True" />
              <TextBlock Grid.Column="1" FontSize="12" VerticalAlignment="Top" Margin="10,0,0,0" TextWrapping="Wrap" TextTrimming="WordEllipsis" Text="{Binding Status}" />
            </Grid>
          </StackPanel>
        </Border>
      </Grid>
      <s:SurfaceButton x:Name="_closeBtn" x:FieldModifier="private" ContactTapGesture="Close_ContactTapGesture" Style="{DynamicResource CloseButtonStyle}" VerticalAlignment="Top" Foreground="{DynamicResource ForegroundBrush}" Background="{DynamicResource ForegroundBrush}" HorizontalAlignment="Right"/>
      <s:SurfaceButton x:Name="_flipBtn" x:FieldModifier="private" ContactTapGesture="Flip_ContactTapGesture" Style="{DynamicResource FrontFlipButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
    </Grid>
  </Grid>
</s:SurfaceUserControl>