One way would be to bind Tag to the SubLayerID
private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { TextBlock textSender = (TextBlock)sender; string layerName = textSender.Text; var layerId = (textSender.DataContext as LayerItemViewModel).SubLayerId; }
<TextBlock Text="{Binding Label}" VerticalAlignment="Center" Margin="2,0,0,0" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" Tag="{Binding SubLayerID}"/>
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.