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:controls="clr-namespace:LiveStream.Controls"
                      xmlns:props="clr-namespace:LiveStream.Properties"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      mc:Ignorable="d"
                      x:Class="LiveStream.Controls.RiverContent.SmallImage"
                      xmlns:feeditems="clr-namespace:FeedProcessor.FeedItems;assembly=FeedProcessor"
                      d:DesignWidth="168" d:DesignHeight="168">
  <s:SurfaceUserControl.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/LiveStream;component/Resources/Converters.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <feeditems:ImageFeedItem x:Key="DesignData"
                               Date="6/21/2010 10:23:00 AM"
                               Author="MSSurface"
                               Title="This is the image title"
                               Caption="This is the excellent image caption which is a description of the excellent image."/>
    </ResourceDictionary>
  </s:SurfaceUserControl.Resources>
  <Grid d:DataContext="{DynamicResource DesignData}">
    <Border Background="{DynamicResource ThemeBrush}" Opacity=".6" />
    <controls:ImageLoader Style="{DynamicResource ImageLoaderStyle}" x:Name="_image" x:FieldModifier="private" UriSource="{Binding ThumbnailUri}" Stretch="UniformToFill" Label="{x:Static props:Resources.Image}" />
    <Border Background="#4C000000" VerticalAlignment="Bottom" Padding="3">
      <StackPanel>
        <TextBlock TextWrapping="Wrap" Text="{Binding Title}" TextTrimming="WordEllipsis" FontSize="9" MaxHeight="25" Foreground="{DynamicResource ForegroundBrush}" Visibility="{Binding Path=Title, Converter={StaticResource VisibilityConverter}}" />
        <StackPanel Orientation="Horizontal" Opacity=".5">
          <TextBlock x:Name="_posted" x:FieldModifier="private" FontSize="9" Foreground="{DynamicResource ForegroundBrush}" Text="{x:Static props:Resources.Posted}" />
          <TextBlock FontSize="9" Foreground="{DynamicResource ForegroundBrush}">
            <TextBlock.Text>
              <Binding Path="Date" StringFormat="{x:Static props:Resources.DateFormat}" />
            </TextBlock.Text>
          </TextBlock>
          <StackPanel Orientation="Horizontal" x:Name="_author" x:FieldModifier="private">
            <TextBlock FontSize="9" Foreground="{DynamicResource ForegroundBrush}" Text="{x:Static props:Resources.By}" />
            <TextBlock TextTrimming="CharacterEllipsis" FontSize="9" Foreground="{DynamicResource ForegroundBrush}" Text="{Binding Path=Author}" />
          </StackPanel>
        </StackPanel>
      </StackPanel>
    </Border>
  </Grid>
</s:SurfaceUserControl>