StreamLink for Silverlight
Examples

Running Examples in Visual Studio

Example code is available in the StreamLinkForSilverlightExample.zip file stored at C:\Program Files\Caplin Systems Ltd\StreamLink for Silverlight\examples within the installed distribution.

Extract the contents of this file to a suitable location on your system.

Within the top level folder of the unzipped file there is a Visual Studio 2008 solution file, Silverlight-StreamLinkExamples.sln.

When Visual Studio first loads the project it may popup a message box saying

You should answer Yes.

(Note: If you have the Perforce source control system installed then you will receive different message dialogs, but again the source control system should be disabled).

Updating project references

Before you can run the examples you will need to correct the project references to point to the Caplin.StreamLink.Silverlight.dll.

In the solution explorer expand the References within the projects in the Silverlight-StreamLinkExamples solution.

Remove the reference to Caplin.Streamlink.Silverlight (by right clicking and choosing Remove)

Then right click on the References folder and choose 'Add Reference'

Click on the 'Browse' tab and then navigate to the following file C:\Program Files\Caplin Systems Ltd\StreamLink for Silverlight\bin\Caplin.StreamLink.Silverlight.dll

Once the assembly has been correctly referenced you need to change its "Copy Local"  property to True:

Right click on the Caplin.StreamLink.Silverlight reference and choose the "Properties" option.

Then Change the 'Copy Local' property to True:

Install Silverlight Toolkit

The StreamLink for Silverlight Chart example requires the Microsoft Silverlight Toolkit for Silverlight 3.

Once this has been installed the System.Windows.Controls.DataVisualization.Toolkit reference will resolve.

Setting up the server environment

Note: The following assumes that you have a default install of Liberator available and have not changed your Liberator configuration (rttpd.conf).

For the examples to work you will need to run the demosrc datasource that comes as standard with the Liberator using the demosrc.conf file that can be found in the Files solution folder of the Silverlight-StreamLinkExamples solution.

You will find the existing demosrc.conf file in the following directory on server which your Liberator is installed on:

Replace the existing demosrc.conf with the supplied demosrc.conf and run:

Setting which Liberator the examples will connect to

Each example within the solution has a hard-coded configuration to point at a Liberator location at localvm.caplin.com:<PORT>. These references will have to be updated to point to the location of your Liberator. The references can be found in:

Setting up the SilverlightStreamLinkExamples.Web project

For the examples to run the project must be marked as the StartUp project. To do this right click on the project icon and select "Set as StartUp Project"

In addition the Default.aspx should be set as the start page by right-clicking on it and selecting "Set as Start Page".

You should now be able to run the StreamLink for Silverlight examples. The Default.aspx page will provide you with links to a Grid and a Chart example.

Grid Example

The Grid Example programmatically configures a StreamLink object. For more information see the factory methods available on the Caplin.StreamLink.Configuration.SimpleConfiguration static helper class.

Chart Example

The Chart Example uses a configuration file to configure a StreamLink object. For more information see Caplin.StreamLink.StreamLink in addition to the StreamLink Configuration XML Reference which can be found in the docs folder of your StreamLink for Silverlight installation folder.

The chart example uses a factory helper object to get around the restriction of calling the StreamLink(Uri) on the UI Thread in Silverlight.