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. 支持滚动条: ...
随机推荐
- 关于在iBatis中配置Oracle以及MySQL 自增字段
<insert id="insertPerson" parameterClass="person"> <!-- MySQL数据库自增字段的控制 ...
- hdu 2824 The Euler function 欧拉函数打表
The Euler function Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- 模版层Template layer
每一个Web框架都需要一种很便利的方法用于动态生成HTML页面. 最常见的做法是使用模板. 模板包含所需HTML页面的静态部分,以及一些特殊的模版语法,用于将动态内容插入静态部分. 说白了,模板层就是 ...
- 字符集(编码)转换_Linux
ZC: 来自 我的项目 czgj 1.代码: #include <stdio.h> #include <iconv.h> #include <string.h> / ...
- 原生 js 时钟实现
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- http-server 基于nodejs的http服务器
http-server所用场景: 作为前端的同学来说,想要运行一段代码,但又没有必要使用tomcat或是Apache http server,这个时候,一个简单的轻量的http-server就能搞定. ...
- 读CSV文件
/// <summary> /// 读取csv文件 /// </summary> /// <param name="csvPath">strin ...
- How to implement connection pool in spark streaming
在spark streaming的文档里,有这么一段: def sendPartition(iter): # ConnectionPool is a static, lazily initialize ...
- 20170728xlVba简单的匹配
Sub MatchData() Dim i As Long, EndRow As Long, Key As String Dim Rng As Range Dim Dic As Object Set ...
- Mass Change Queries CodeForces - 911G (线段树合并)
链接 大意: 给定序列, 每次操作将区间[l,r]中的x全改为y, 最后输出序列 权值范围比较小, 对每个权值开一颗线段树, 每次将x合并到y上即可 #include <iostream> ...