I m writting aWindows Telephone App, in the GUI a have a list Box with many htons, some such as this
<ListBox x:Name="List">
<ListBox.ItemTemplate>
<DataTemplate>
<Button Width="460" Height="100" Click="Click_B">
<Button.Content>
<StackPanel Orientation="Horizontal" Height="80" Width="400">
<TextBlock Width="200" Name="txtblockName" FontSize="22" Text="{Binding Name}" Height="40"/>
<TextBlock Width="200" Name="txtblockUrl" FontSize="22" Text="{Binding Url}" Height="40"/>
</StackPanel>
</Button.Content>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
当我点击布顿时,我需要获得“txtblock Url”文本的内容,我如何能够获得这一价值?
private void Click_B(object sender, RoutedEventArgs e)
{
Button source = (Button)e.OriginalSource;
}