android - 在 Xamarin Forms 中绑定之前修改数据
问题描述
我是 Xamarin Forms 的新手。我正在从我的 Web 服务器数据库将数据绑定到 ListView。我的网络服务器中有 2 个表。
- Tb_Country
- Tb_Region
Tb_Region 表中有一个 country_id 列。我在我的 ListView 中显示区域列表。但我得到的只是 country_id。我还想显示 Tb_Country 的国家名称。我怎样才能做到这一点?
解决方案
也许您需要 ListView 中的 DataTemplate?
<ListView x:Name="EmployeeView"
ItemsSource="{Binding Employees}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding DisplayName}" />
</DataTemplate>
</ListView.ItemTemplate>
推荐阅读
- azure - Azure SQL 数据库动态数据屏蔽不会保存一列
- php - 多维数组 - 替换
- java - 通过比较单词来比较字符串,只检查单词中相同数量的字母
- sql - SQL Graph:列出从根开始的所有路径,到达各种类型的对象
- java - 如何使用我的 Java Web 服务编写预期的 JSON 字符串响应
- sql-server - 如何调试过程错误`必须声明表变量“@table1”`
- kotlin - 如何确定 FlowCollector 是否关闭?
- java - 如何使用多个 yaml 文件生成 openAPI 代码
- javascript - 如何在发布我的自定义 vscode 扩展时修复“拒绝访问以执行此操作:查看资源的用户权限”
- javascript - 加速动画anime.js