Dear Experts , i want to bind Main MapPage to another user control , my user control have only XML no CS codes,
UserControl Codes
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,3600000,-11000000,5300000" Background="White">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
</esri:Map>
<Border BorderThickness="1" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,10,48,0" Padding="5" Width="300" >
<ListBox x:Name="MyList" ItemsSource="{Binding ElementName=MyMap, Path=Layers}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!--Layer visibility checkbox-->
<CheckBox IsChecked="{Binding Visible, Mode=TwoWay}" />
<!--Opacity slider-->
<Slider Margin="-5,0,0,0" Minimum="0" Maximum="1" Width="195"
Value="{Binding Opacity, Mode=TwoWay}" Height="18" />
<!--Layer name-->
<TextBlock Text="{Binding ID, Mode=OneWay}" Margin="5,0,0,0" >
<!-- Tooltip on hover-->
<ToolTipService.ToolTip>
<StackPanel MaxWidth="400">
<TextBlock FontWeight="Bold" Text="{Binding CopyrightText}" TextWrapping="Wrap" />
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
</StackPanel>
</ToolTipService.ToolTip>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
My Map Page Map Codes for Map is
<esri:Map x:Name="myMap" Width="Auto" Height="Auto" Progress="MyMap_Progress" ExtentChanged="MyMap_ExtentChanged" IsLogoVisible="False" MouseMove="MyMap_MouseMove" Margin="0,70,0,0" >
<esri:ArcGISTiledMapServiceLayer ID="Carto1"
Url="http://localhost:6080/arcgis/rest/services/Carto1/MapServer"/>
<esri:GraphicsLayer ID="MyGraphicsLayer" />
i use MapControl Var for map page map control , but i using LayerList Sample which have no C# codes
Sorry I don't get what your issue is.
The sample you pointed out is working well. What do you want to change in the sample that is not working?
sir , i use Different user Control , Sample only working on my current user control not in Main Map , i want bind this user control to my main Map Page , Layer list Sample is only xml Based . how i use MapControl Var in xml. or how i bind widget user control to main map page?