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}"/>
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.