1

我附上了一张图片。表格视图可以有多个标题并按子模型分组吗?

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

public class ModuleViewModel
{
    public string Title { get; set; }
    public IList<MediaViewModel> Media { get; set; }
}

public class MediaViewModel
{
    public string Title { get; set; }
    public string Icon { get; set; }
    public ModuleSectionViewModel ModuleSection {get; set;}
}

public class ModuleSectionViewModel
{
    public string Title { get; set; }
}
  1. 您在图像中看到的视图是 ModuleView
  2. TableView(滑动导航位)会将它的源绑定到 Media 属性
  3. 该表将按 ModuleSection.Title 属性分组

这可能吗?如果是这样,我会从哪里开始?

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

在此处输入图像描述

4

1 回答 1

0

TableView现在还不能完全绑定。但是您可以通过对其进行子类化并将该TableView.Root属性分配给覆盖中的构造TableRootOnBindingContextChanged()获得类似的结果。

于 2014-06-20T07:33:54.480 回答