xamarin - 无法两次点击相同的列表视图项目xamarin
问题描述
在使用 SelectedItem 属性的 xamarin 列表视图中,我无法访问相同的列表视图项两次。1.点击列表中的一个项目。它导航到其他后面。2.返回上一页并点击它正在导航到其他页面的列表中的相同项目。
<ListView
ItemsSource="{Binding UIUnionListWrapper}"
**SelectedItem="{Binding DeviceSession, Mode=TwoWay}">**
internal DeviceSession _deviceSession;
public DeviceSession DeviceSession
{
get { return _deviceSession; }
set
{
SetProperty(ref _deviceSession, value);
HandleItemSelectedAsync(); //navigating to other page
}
}
解决方案
此代码按预期工作:if (SelectedItem != null){await PushModelPage(newSessionListPage(SelectedItem, Navigation));SelectedItem = null;}
推荐阅读
- c# - C#从文本框中计算多个值
- python - 优化列表内每个类实例的检查属性
- ios - 如何在 Fscalender 自定义 Swift 中更改背景颜色
- python - 将嵌套字典转换为 pandas 数据框
- javascript - Siddhi 读取输入 jsonarray,其中每个元素包含多个字段
- c++ - 如果语句在 for 循环内,则 C++ 访问 if 语句
- spring-boot - 用于 Post API 的 RestController 中的 @Request String 有效负载
- pandas - 对于多行中的 id,查找 pandas 中是否存在值
- sql - 如何在 SQL 中拉取参加 5 次或更多 unqiue 事件的人数?
- javascript - 如何删除 e.preventDefault() 以允许从以下脚本中“剪切复制粘贴”