Select to view content in your preferred language

Silverlight API 3.2 Samples

613
3
06-16-2014 11:32 AM
ELIZABETHF_T_
New Contributor III
I'm trying to add a sample to the ESRIStandardMapapplication template, but I'm having a hard time using the same map.  How can I use the same map without adding all the xmal code into the MainPage.xaml, I'd like to keep it in folders.

I want this to bind this to the Map! How can I do this?
<esri:Map x:Name="MyMap" Extent="-118.331,33.7,-116.75,34" >
                <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
                      Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
                <esri:GraphicsLayer ID="MyGraphicsLayer" />
</esri:Map>


This is on the MainPage.xaml:
     <esri:Map x:Name="Map" Background="White" WrapAround="true">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseEnter">
                    <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                        <ei:ChangePropertyAction.Value>
                            <Visibility>Collapsed</Visibility>
                        </ei:ChangePropertyAction.Value>
                    </ei:ChangePropertyAction>
                </i:EventTrigger>
            </i:Interaction.Triggers>
         <esri:ArcGISTiledMapServiceLayer ID="BaseLayer"
          Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
        </esri:Map>
0 Kudos
3 Replies
AhmedEl-Sisi
Occasional Contributor III
Hi Eliza,

You can make a DependencyProperty in your new control then pass the map object to it.
Check the attached sample.

Regards,
0 Kudos
ELIZABETHF_T_
New Contributor III
The dependency property works with any silverlight sample.  I'm still confuse?
0 Kudos
AhmedEl-Sisi
Occasional Contributor III
The dependency property works with any silverlight sample.  I'm still confuse?

It depends on what you want, but basically if you want to pass object from your MainPage -which hosts your controls- to your child controls, you can use dependency property as you can bind to it.
0 Kudos