If you have the editor defined in the resources, note that WPF (as opposed to Silverlight) doesn't support ElementBinding, so you will have to set the Map property in codebehind.
<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="30" 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>
Public Class MapFeatureSelect Private _vm As New LayerViewModel Public MyEditor As New ESRI.ArcGIS.Client.Editor Sub New() DataContext = _vm Resources.Add("MyEditor", MyEditor) ' This call is required by the designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. EditorToolStrip.DataContext = MyEditor End Sub Private Sub MyMap_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyMap.Loaded Dim lst As New List(Of String) lst.Add("SelectionLayer") With MyEditor .Map = MyMap .SelectionMode = ESRI.ArcGIS.Client.DrawMode.Rectangle .LayerIDs = lst End With End Sub End Class
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.