使用以下 XAML 如何<TextBlock/SenderName>
根据列表视图当前选定的项目检索假设或嵌套在堆栈面板中的任何其他控件的值?在 C# 中
XAML
<ListView x:Name="ItemListView"
ItemsSource="{Binding}"
Margin="1041,120,85,68" SelectionChanged="ListView1_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding SenderName}"
FontSize="20" Margin="15,0,0,0" HorizontalAlignment="Right" />
<TextBlock Text="{Binding Value}"
FontSize="18" Margin="5,0,0,0" TextWrapping="Wrap" HorizontalAlignment="Right" />
<TextBlock Visibility="Collapsed" Text="{Binding StreamId}" />
<TextBlock Text="{Binding DateTime}"
FontSize="16" Margin="15,0,0,0" HorizontalAlignment="Right" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>