【发布时间】:2020-05-08 23:43:15
【问题描述】:
我在 WPF C# 中的一个小项目患者管理中工作,我想为患者创建列表(就像图片左侧的列表 enter image description here)。 我怎么能喜欢它我不知道我应该使用哪些工具。 请帮忙。 谢谢你。
【问题讨论】:
我在 WPF C# 中的一个小项目患者管理中工作,我想为患者创建列表(就像图片左侧的列表 enter image description here)。 我怎么能喜欢它我不知道我应该使用哪些工具。 请帮忙。 谢谢你。
【问题讨论】:
在 C# 中,您在图片中显示的患者列表可以定义如下:
public class PatientItem
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Gender { get; set; }
public int Age { get; set; }
public int VisitorId { get; set; }
public string Diagnosis { get; set; }
public string FileNamePicture { get; set; }
}
患者列表定义为:
List<PatientItem>
下一步是定义布局 XAML 和 C#。
一个例子可以在https://www.wpf-tutorial.com/list-controls/itemscontrol/找到
在该示例中,将 TodoItem 替换为 PatientItem 并更改绑定和 XAML,以从 PatientItem 而不是 TodoItem 更新您的布局。
要绑定您的图片有几个选项,请参阅例如在这里回答,
【讨论】: