How to incorporate sample code examples into viewer built with Silverlight Builder?

530
1
01-14-2014 10:20 AM
brucesimonson
New Contributor III
Hi All,

Based on the premise that no question is stupid, unless unasked, I'm not sure how to incorporate any of the online code samples into the map app I'm developing using Silverlight Builder.

For a concrete example, I'd like to make the following available in my app:

   https://developers.arcgis.com/en/silverlight/sample-code/start.htm#Identify

Following the lead in these instructions (from MapScaleSetting.AddIns.xap, downloaded from a blog reference, not from the online code samples):

[INDENT]
Deploy, enable, and use the Map Scale Settings add-in as described below.

Deploy the add-in:
1.) Open the ArcGIS Viewer for Silverlight's Application Builder
2.) In the Application Builder, click Settings
3.) On the Settings page, click the Add-Ins tab.
4.) On the Add-Ins tab, click the Upload Add-In button.
5.) In the Open File dialog, browse to the MapScaleSettings.AddIns.xap file (included with the sample) and double-click it.

Enable the add-in for a Viewer application:
1.) From the Application Builder home page, start creating a new Viewer application by clicking the Create New Application button.
2.) Choose the map you wish the start with in your Viewer application.
3.) On the Tools tab of the Application Builder's toolbar, click the Add Behaviors button.
4.) In the Add Behavior dialog, select the Map Scale Settings behavior and click Next.
5.) Click OK.

Once the add-in is enabled, specify map scale settings as follows:
1.) From the Tools tab of the Application Builder's toolbar, click the Manage Behaviors button.
2.) In the table that displays behaviors in the current application, cick the Map Scale Settings behavior.
3.) Click the Configure button
4.) On the Scale Settings dialog, specify the settings as desired.

[/INDENT]

I copied the code from the website's sample (XAML version) into a notepad file, and saved it as Identify.AddIns.XAP (? ... that's a guess on my part, which I'm not betting is the right thing to do).  Then, trying to follow the gist of the above instructions, I can get through all the steps in "Deploy the add-in:".  However, I'm fairly convinced that this not is the right way to do this, because there is no information in the associated "Add-in Details" for "Identify.AddIns".

Nevertheless, forging ahead, and trying to follow the gist of the second set of instructions ("Enable the add-in for a Viewer application") results in a fail, as the new Identify AddIn doesn't show up in the list of available add-in behaviors that are available to my Builder app.

I suspect there is something basic I need to know, and have missed. 

I would really like to incorporate some of the source code from the samples site, using the Builder application, without doing a full-blown Visual Studio and Silverlight API installation, with the associated learning curve.  I wanna KISSAP (keep it simple, stupid, as possible), at this point.

It could be as straightforward as getting specific instructions on how to package sample code from the website into an acceptable XAP package, so it can be accessed as an Add-In in Silverlight Builder.

Serious thanks, if you can help me through this.

Cheers,
-Bruce
0 Kudos
1 Reply
BrentHoskisson
Occasional Contributor III
I got started by going to XAML and Code Behind tabs on ESRI's sample pages and copy/pasting right into my project.  At that point, you don't have to change a thing.  Just push F5 and you get a web page that does what the sample does.  From there, you can change what the map is pointing to and other things until you get it the way you want.  Then go to the next sample. 

Of all the API's I've tried Silverlight is the easiest to figure out in my opinion.  I wish all of their API samples were done just like the Silverlight samples.

Good Luck
0 Kudos