xaml页面
<ListBox Name="noteListBox"
VerticalContentAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<HyperlinkButton Name="noteLocation"
HorizontalContentAlignment="Stretch"
FontSize="42"
VerticalContentAlignment="Stretch"
Content="{Binding noteLocation}"
Click="Mylik_click"
Tag="{Binding filename}"/>
<TextBlock Name="noteCreatetime"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="10"
Text="{Binding noteCreatetime}"
/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
cs页面
//点击日记进行导航
private void Mylik_click(object sender, RoutedEventArgs e)
{
HyperlinkButton likbtn = (HyperlinkButton)sender;
string filename = likbtn.Tag.ToString();
string url = String.Format("/MyNote;component/ViewEdit.xaml?id={0}", filename);
NavigationService.Navigate(new Uri(url, UriKind.Relative));
}
这里主要是想说下点击的时候区别哪个点的