复合视图中的两个集合 [英] Two Collections inside a Composite View

查看:109
本文介绍了复合视图中的两个集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此​​,我们在一个项目中使用的提线木偶的工作,我们已经取得了良好的进展,到目前为止,但我们跟木偶嵌套视图模型的一部分​​,

So we are working on a project using marionette and we have made a good progress so far, but we struggling with a part of the marionette nested view model,

所以让我们假设我们有一个公寓(psented作为一个复合视图重新$ P $),公寓包含客房的集合和椅子的集合,我们想要做的是有房间和椅子的直接在aprtment复合视图的下降,我们如何能做到这一点,知道复合视图只能有一个孩子的收集,我们应该使用区域?

so lets assume that we have an apartment (represented as a composite view), and the apartment contains a collection of rooms and a collection of chairs, what we want to do is have the rooms and chairs a direct descending of the aprtment composite view, how can we do this, knowing that the composite view can only have one child collection, should we be using regions?

推荐答案

您是否尝试过使用布局呢?它支持区和一个ItemView控件(如果需要)。我使用这个问题的方法是定义在布局几个区域;显示在每个区域中的布局模板集合视图或项目视图和其它任何东西的公寓。所以,你的例子,你的户型将包含所有的公寓属性和椅子区域将包含一个椅子集合视图和客房区域可能包含室集合视图。

Have you tried using a Layout instead? it supports regions and an itemview (if needed). The way I am using this is to define several regions in the layout; show a collection view or item view in each region and any other apartment stuff in the layout template. so, for your example, your apartment layout would contain all of the apartment attributes, and a chairs region would contain a chairs collection view, and a rooms region could contain a rooms collection view.

这篇关于复合视图中的两个集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆