Technical Documentation

This document describes the perquisites for building the Microsoft Surface Live Stream Code Sample as well as gives a high-level overview of the application structure. For regular usage of the application as-is, see the other documentation included in the download.

Building the Project

You will need the following installed on your machine in order to open and build the project:

API Keys

You will need to acquire your own API keys for the Flickr and Microsoft Tag services. Flickr API keys can be obtained here; the Tag API keys can be obtained here. These keys are stored in the Constants.cs file.

Technical Overview

The solution includes four projects:

LiveStream Project

The main control which arranges the feed items and scrolls them along is called “River”, and lives in Controls/River.xaml. The layout of the river is not procedurally generated, instead it lives in the “RiverLayout” resource inside Resources/Resources.xaml.

Each item within the river is an instance of Controls/RiverContentItem. RiverContentItem contains an instance of all of the controls in Controls/RiverContent, such as “SmallTweet” for a tweet shown within the stream, and “LargeTweet” when it’s pulled out. Changing the looks of these controls would change the look of the entire application, and these controls are easily editable in Blend.

RiverContentItem is contained within a ScatterViewItem, the style for which is “FlippingScatterViewItemStyle”, in Resources/Resources.xaml.

FeedProcessor Project

You may want to change the behavior of how feeds are loaded in your application, or add new types of feeds. To do so, review the behavior of the Processor class.

To create a new type of feed, create a new class which inherits from FeedProcessor.Feed, which will handle the logic of requesting and parsing data. Create another class which inherits from FeedProcessor.FeedItem, which will represent items from that source. You may also need to add values to FeedProcessor.Enums.ContentType and FeedProcessor.Enums.SourceType.

Then review the logic in FeedProcessor.Processor and add the necessary properties and methods for your new type, following the same pattern as those used for Twitter, Flickr, and news.

Then you’ll need to modify RiverContentItem in the main project to display the new items.