Select to view content in your preferred language

Silverlight Sample used for Add-in for Silverlight Viewer HELP ???

2212
0
05-03-2012 09:58 AM
deleted-user-yA_w_FC9FKe5
Deactivated User
I found a silverlight sample http://help.arcgis.com/en/webapi/silverlight/1.2/samples/start.htm#Bookmarks that will do what I am looking to do in the viewer.  It looks pretty straight forward but I would like to do this as an add-in for the viewer.  The viewer is so awesome it is a shame it does not have a simple bookmark sample but I am determined to figure this thing out somehow. 

Is this possible?  If so how would I go about doing that?  I just wish I understood silverlight and C# a little. 

Thanks,

Michael

This is what the code looks like from the silverlight API

XAML  Code:
<UserControl x:Class="ArcGISSilverlightSDK.Bookmarks"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
    xmlns:esriToolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit">
    <Grid x:Name="LayoutRoot" Background="White">
       
        <esri:Map x:Name="MyMap" Background="White" Extent="-130,10,-70,60">
            <esri:Map.Layers>
                <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
                      Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
            </esri:Map.Layers>
        </esri:Map>
       
        <esriToolkit:Bookmark x:Name="MyBookmarks" Width="125" HorizontalAlignment="Right" VerticalAlignment="Top"
             Margin="0,10,10,0" Background="#99257194" BorderBrush="#FF92a8b3" Foreground="Black"
             Map="{Binding ElementName=MyMap}"
             Loaded="MyBookmarks_Loaded" />
       
    </Grid>
</UserControl>

C# Code:
using System.Windows;
using System.Windows.Controls;

namespace ArcGISSilverlightSDK
{
    public partial class Bookmarks : UserControl
    {
        public Bookmarks()
        {
            InitializeComponent();
        }

        private void MyBookmarks_Loaded(object sender, RoutedEventArgs e)
        {
            //MyBookmarks.ClearBookmarks(); // Remove all bookmarks
            //MyBookmarks.AddBookmark("Mix - Las Vegas", new ESRI.ArcGIS.Client.Geometry.Envelope(-115.212, 36.083, -115.111, 36.157));
            //MyBookmarks.AddBookmark("DevSummit - Palm Springs", new ESRI.ArcGIS.Client.Geometry.Envelope(-116.55, 33.816, -113.525, 33.834));
            //MyBookmarks.AddBookmark("User Conference - San Diego", new ESRI.ArcGIS.Client.Geometry.Envelope(-117.211, 32.665, -117.11, 32.739));
        }
    }
}
0 Kudos
0 Replies