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}"/>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.