Xamarin.forms TableView可以有多个标题吗?
我附上了一张图片。tableview是否可以有多个标题并按子模型分组 我的模型结构看起来像这样 公共类ModuleViewModel { 公共字符串标题{get;set;} 公共IList媒体{get;set;} } 公共类MediaViewModel { 公共字符串标题{get;set;} 公共字符串图标{get;set;} public ModuleSectionViewModel ModuleSection{get;set;} } 公共类模块SectionViewModel { 公共字符串标题{get;set;} } 您在图像中看到的视图是ModuleView 滑动导航位的TableView将其源绑定到媒体属性 该表将按ModuleSection.Title属性分组 这可能吗?如果是,我从哪里开始 为了增加复杂性,我更喜欢在Xaml中进行绑定:Xamarin.forms TableView可以有多个标题吗?,xamarin.forms,Xamarin.forms,我附上了一张图片。tableview是否可以有多个标题并按子模型分组 我的模型结构看起来像这样 公共类ModuleViewModel { 公共字符串标题{get;set;} 公共IList媒体{get;set;} } 公共类MediaViewModel { 公共字符串标题{get;set;} 公共字符串图标{get;set;} public ModuleSectionViewModel ModuleSection{get;set;} } 公共类模块SectionViewModel { 公共字符串
TableView现在不能完全绑定。但是,通过将其子类化,并在OnBindingContextChanged覆盖中将TableView.Root属性分配给构造的TableRoot,可以获得类似的结果。我不确定这对多个类别/组有何帮助?我不是怀疑你,只是不知道如何完成它。