Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.forms TableView可以有多个标题吗?_Xamarin.forms - Fatal编程技术网

Xamarin.forms TableView可以有多个标题吗?

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是否可以有多个标题并按子模型分组

我的模型结构看起来像这样

公共类ModuleViewModel { 公共字符串标题{get;set;} 公共IList媒体{get;set;} } 公共类MediaViewModel { 公共字符串标题{get;set;} 公共字符串图标{get;set;} public ModuleSectionViewModel ModuleSection{get;set;} } 公共类模块SectionViewModel { 公共字符串标题{get;set;} } 您在图像中看到的视图是ModuleView 滑动导航位的TableView将其源绑定到媒体属性 该表将按ModuleSection.Title属性分组 这可能吗?如果是,我从哪里开始

为了增加复杂性,我更喜欢在Xaml中进行绑定:


TableView现在不能完全绑定。但是,通过将其子类化,并在OnBindingContextChanged覆盖中将TableView.Root属性分配给构造的TableRoot,可以获得类似的结果。

我不确定这对多个类别/组有何帮助?我不是怀疑你,只是不知道如何完成它。