我正在使用a CollectionViewSource
来分组我的数据.在我的数据中,我有Property1
并且Property2
我需要分组.
唯一的规定是我不想要另一组的子组.因此,当我按这两个属性进行分组时,我不希望它Property2
因为一个子组的Property1
's group.
我想要这个的原因是因为我需要一个显示以下信息的标题:
标题:
<TextBlock.Text>
<MultiBinding StringFormat="Property1: {0}, Property2: {1}">
<Binding Path="Property1"/>
<Binding Path="Property2"/>
</MultiBinding>
</TextBlock.Text>
Run Code Online (Sandbox Code Playgroud)
我用我的CollectionViewSource尝试了这个,但是无法将组和子组"组合"在一起:
<CollectionViewSource x:Key="myKey" Source="{Binding myDataSource}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Property1" />
<PropertyGroupDescription PropertyName="Property2" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
Run Code Online (Sandbox Code Playgroud)
是否可以将两个属性组合在一起?像下面的东西?
<CollectionViewSource x:Key="myKey" Source="{Binding myDataSource}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Property1,Property2" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
Run Code Online (Sandbox Code Playgroud) 我使用 Visual Studio 2015。每次当我连接到 TFS 时遇到问题(网络问题或 TFS 已关闭)时,我无法在源代码管理下打开解决方案。VS 卡住了,我无法继续工作。我从一位同事那里得到了一个建议:禁用 PC 上的网卡,但这听起来很荒谬!我记得当我使用 VS 2010-2012 时 - 我肯定能够离线工作!我刚刚收到一条类似“离线工作”的消息,就是这样!但现在每次没有 TFS 我就无法工作。我觉得应该是设置的问题,但是我没找到。有人有解决方案吗?
我从事代表模型的 Razor Page 项目,Lists
并且Records
:
public class List
{
public int ID { get; set; }
[StringLength(25, MinimumLength = 3, ErrorMessage = "Title should be in range between 3 and 25")]
[Display(Name = "Title")]
public string Caption { get; set; }
public string UserId { get; set; }
public User User { get; set; }
public ICollection<Record> Records { get; set; }
}
public class Record
{
public int ID { get; set; }
[StringLength(25, MinimumLength = …
Run Code Online (Sandbox Code Playgroud)