首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

wp7 开发学习之 ListBox 小施用二

2012-09-29 
wp7 开发学习之 ListBox 小应用二xaml页面 ListBox NamenoteListBoxVerticalContentAlignmentStretc

wp7 开发学习之 ListBox 小应用二

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));
}

这里主要是想说下点击的时候区别哪个点的

热点排行