ListBox 控件单击事件
XAML:
<ListBox x:Name="ItemBox" Grid.Column="0" Tap="ItemBox_Tap">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="300" Height="150" Margin="12,0,0,20">
<Border Background="#01BCF3">
<Image Source="" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}" />
</Border>
<StackPanel VerticalAlignment="Top" Margin="10,0" >
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Margin="10,0" FontSize="24" Style="{StaticResource PhoneTextTitle3Style}" />
<!--<TextBlock Text="{Binding PublishDate}" Margin="10,0" FontSize="18" Foreground="#FF8F8F8F"/>-->
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
后台代码:
private void ItemBox_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
var item = ItemBox.SelectedItem as CourseItem;
CommonConfig.SelectedItem = item;
//this is the fake course page in App
this.NavigationService.Navigate(new Uri("/CoursePage.xaml", UriKind.Relative));
}
其中ItemBox的数据源是List<CourseItem>.
ListBox 控件单击事件的更多相关文章
- C#treeView控件单击事件选中节点滞后问题解决方法
问题描述:在treeView的Click事件中,选中的节点SelectedNode并不是您刚才点击的节点,总是上一次选中的节点,节点选中滞后的问题. 解决方案:在treeView的MouseDown事 ...
- asp.net中的ListBox控件添加双击事件
问题:在Aspx页里的ListBox A中添加双击事件,将选中项添加到另一个ListBox B中,双击ListBox B中的选中项,删除当前选中项 页面: <asp:ListBox ID=&qu ...
- asp.net Listbox控件用法
2008-02-18 19:56 来源: 作者: ListBox(列表框)控件可以显示一组项目的列表,用户可以根据需要从中选择一个或多个选项.列表框可以为用户提供所有选项的列表.虽然也可设置列表框为多 ...
- ListBox控件
主要介绍:自定义数据.绑定数据库数据 前台代码: <div> <asp:ListBox ID=" Width ="100px"> <asp: ...
- c# ListBox控件
ListBox控件可以一次呈现多个项,并且语序对控件中的选项进行选择操作,ListBox类公开Items属性,它是一个集合,类型为ListBox.ObjectCollection,是ListBox的一 ...
- 如何给ActiveX控件添加“事件”“属性”“标准事件”“自定义事件”等一些相关操作
上一篇小编带大家熟悉了一下ActiveX的建立以及相关的概念,(http://blog.csdn.net/u014028070/article/details/38424611) 本文介绍下如何给控件 ...
- c#控件攻略宝典之ListBox控件
ListBox控件的使用: 1)控件属性 Items SelectedItems SelectioModes 2)数据绑定 DataSoure DisplayMember ValueMenber 3) ...
- listbox控件使用
1. 属性列表: SelectionMode 组件中条目的选择类型,即多选(Multiple).单选(Single) Rows 列表框中显示总共多少行 Sel ...
- 使用 xlue 实现简单 listbox 控件
基于 XLUE 实现的 listbox 控件 1. 提供增删查接口,将 obj 作为子控件添加到列表: 2. 提供 Attach/Detach 方法,可以将子控件的事件转发出来: 3. 支持滚动条: ...
随机推荐
- codeforces 352 div 2 C.Recycling Bottles 贪心
C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standar ...
- shell case语句
case 格式 case 值 in 模式1) command1 command2 ... commandN ;; 模式2) command1 command2 ... commandN ;; esac ...
- python中sys.stdout、sys.stdin
如果需要更好的控制输出,而print不能满足需求,sys.stdout,sys.stdin,sys.stderr就是你需要的. 1. sys.stdout与print: 在python中调用print ...
- VS 常见快捷键有哪些
自动对齐点[编辑]-[高级]-[设置选定内容的格式]或者按Ctrl + K 然后再按Ctrl + F 就好了 你可以在常用快捷键自定义 窗口中进行查看1.进入工具-选项 对话框2.选择[环境]-[键盘 ...
- LRU缓存淘汰算法
什么是LRU算法? LRU是Least Recently Used的缩写,即最近最少使用,在有限的内容块中存储最近使用次数最多的数据,当内容块已满时,把最少使用的数据删除以便存储新的内容.
- 常用HTTP contentType与后端处理方式
常用HTTP contentType与后端处理方式 1.Content-Type:application/x-www-form-urlencoded; charset=UTF-8 前端export.j ...
- linux 查找
linux下的查找命令有很多,常用的有which.whereis.locate.find.平时在网上搜索一些教程的时候,经常会有让使用这四条命令中的一条去查找一些东西,但是经常这次说用which,下次 ...
- dp入门:最长不下降序列
#include "bits/stdc++.h" using namespace std; ],dp[]; int main() { int n; cin >> n; ...
- Mac安装fish shell
1.brew update 2.brew install fish 3.sudo vi /etc/shells 增加内容:/usr/local/bin/fish ##增加fish到shell环境变 ...
- winRAR显示树树目录
这样 比较方便