Ok, I have the folllowing, XAML markup in a Silverlight MVVM Light app. This is part of the view. In the click event of the btnClearBodyMark in the view's codebehind I've tried traversing the tree upward using the .Parent properties, first parent is the horizontal stackpanel, then it's parent is the vertical stackpanel, and its parent is the Grid, but then the Grid's parent is another Grid?? How can I get a reference to the ListBoxItem that the button belongs to???
<ListBox Name="listboxBodyMarkValues" ItemsSource="{Binding}" Height="Auto" Width="Auto" SelectionChanged="listboxBodyMarkValues_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<StackPanel x:Name="stackBodyMarkList" Orientation="Vertical" Margin="5" Height="Auto">
<StackPanel Orientation="Horizontal" Margin="5" Height="Auto">
<TextBlock x:Name="txtId" Width="50" Height="Auto" Margin="10" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" Text="{Binding Id}" />
<ComboBox x:Name="comboDom1" Width="100" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" ItemsSource="{Binding Dom1}" SelectedItem="{Binding Dom1SelectedItem, Mode=TwoWay}" Visibility="{Binding ComboIsVisible}"/>
<Button x:Name="btnClearBodyMark" Content="Delete Body Mark" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Center" Click="btnClearBodyMark_Click" />
</StackPanel>
<TextBox x:Name="txtNotes" VerticalAlignment="Stretch" VerticalContentAlignment="Top" HorizontalAlignment="Stretch" TextWrapping="Wrap" Text="{Binding ManualText, Mode=TwoWay}" AcceptsReturn="True" Margin="5" MaxWidth="400" MaxHeight="200" VerticalScrollBarVisibility="Auto" IsEnabled="{Binding ManualTextIsEnabled}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>