(Not Signed In)

Sign In

Resources

Create a SilverStream-specific Visual Studio Silverlight project

This simple tutorial walks you through the process of creating a Visual Studio project for use with SilverStream. This project is a useful template for your own applications. This tutorial is one of many Telogis Silverlight API tutorials.

Adding a Client Access policy

Before most SilverStream projects can work, you must specify a client access policy that allows them to meet security constraints for internet access.  This process is described in the topic "Starting with Silverlight" in the SilverStream documentation. If you have not already done so:

Creating a new project

Launch Visual Studio and select File | New Project...

Select a Silverlight project from the left-hand pane, and name the project appropriately. Click OK.

If prompted, select to host the new application in a web site.

Your Silverlight/SilverStream application may behave differently in a test page. It is good practise to develop your application in an environment that is as close to the deployment environment (typically a web site) as possible. For this reason it's recommended that you host the new application in a web site.


Add a reference to the SilverStream DLL

Right-click References in Solution Explorer and select Add Reference...

Select the Browse tab and locate Telogis.GeoBase.SilverStream.dll. Select the DLL and click OK.

Configuring a GeoStream Server

SilverStream obtains map and routing information from a GeoStream server. You should set the Telogis.GeoBase.Settings.ServerUrl property to the URL of a GeoStream server. If you don't do this your SilverStream application will be unable to display map data.

For the purpose of the quickstart guides it is sufficient to open App.xaml.cs and modify the Application_Startup method to match the code snippet below. It's assumed that you are running a GeoStream server on your local machine (GeoBase installed a GeoStream server by default). Otherwise, modify the server URL string as appropriate.

private void Application_Startup(object sender, StartupEventArgs e)
{
  Telogis.GeoBase.Settings.ServerUrl = "http://localhost/GeoStream";
  this.RootVisual = new MainPage();
}

Conclusion

Your project is now ready for SilverStream development! Typically, the next task would be to add the following attribute to your UserControl tag (in the MainPage.xaml source file). This attribute allows your XAML code to access the Telogis.GeoBase namespace.

xmlns:GeoBase="clr-namespace:Telogis.GeoBase;assembly=Telogis.GeoBase.Silverlight"

You are now ready to begin adding your own controls and supporting code.

Next steps

If you're new to SilverStream development we recommend you read the Creating a simple SilverStream map tutorial. This tutorial will show you how to add a map to your project.

This tutorial is one of many Telogis SilverStream tutorials.

 

 

Published, Jun 28th, 15:38

Tagged under: silverlight