There is a list
<ListBox x:Name="listboxFolder" BorderThickness="0" ItemsSource="{Binding Path=ClientsOnlineList, UpdateSourceTrigger=PropertyChanged}" Margin="0,50,0,10" HorizontalAlignment="Left" Width="301" Background="#FFD0E6C5" > <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <EventSetter Event="PreviewMouseLeftButtonDown" Handler="SelectClient"></EventSetter> <Setter Property="Margin" Value="5"/> <Setter Property="Padding" Value="5"/> <Setter Property="Cursor" Value="Hand"/> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Foreground" Value="Green"/>Bold"/> <Setter Property="FontSize" Value="23"/> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate > <DataTemplate > <TextBlock Text="{Binding UserName}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> ClientsOnlineList - List. Contains the fields UserName, id, etc.
How can I find out when selecting a list- which ClientsOnlineList.Id was selected? Since the list is stylized, I was lost in the links and how to find out the selected item?