这是什么'的ItemsSource =" {结合}"“意味着? [英] What does 'ItemsSource="{Binding}"' mean?

查看:115
本文介绍了这是什么'的ItemsSource =" {结合}"“意味着?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图学习WPF被解开写的是谁在这个岗位上我面前的家伙坦白噩梦般的项目。很抱歉,如果我的一些问题是pretty的很多功课级,但我试图找出哪些现有的XAML确实,与它背后的概念的认识不足......

I'm attempting to learn WPF by unravelling a frankly nightmarish project written by the guy who was in this job before me. Sorry if some of my questions are pretty much homework-level but I'm trying to work out what existing XAML does, with an insufficient understanding of the concepts behind it...

不管怎样,我有这样一个ListView作为其定义的一部分:

Anyway, I have a ListView with this as part of its definition:

<ListView 
    DataContext="{StaticResource XMLFileGroups}"
    ItemContainerStyle="{StaticResource XMLItemStyle}"
    ItemsSource="{Binding}">

现在,我可以种让我的头围绕什么的DataContext和ItemContainerStyle线正在做的;他们似乎是引用排序现有列表的方法和结构定义的ListView的一些视觉行为,分别为。

Now, I can kind of get my head around what the "DataContext" and "ItemContainerStyle" lines are doing; they appear to be referencing a method of sorting an existing list, and a structure defining some visual behaviour of the ListView, respectively.

什么是冲倒我就是的ItemsSource被列为{}绑定的事实。所有这一切对我说的是,有一些数据绑定的地方,但我不明白怎么行都不可能是有意义的,但删除其被停止显示任何数据。

What's wrecking me is the fact that the ItemsSource is listed as "{Binding}". All that says to me is that there is some kind of databinding in place, but I don't understand how the line can possibly be meaningful and yet removing it stops any data from being displayed.

有人可以阐明这里发生了什么一些光,或者我应该寻找实际的绑定定义?我只是不明白,我所看到的,在这里。

Can someone shed some light on what is happening here, or where I should look for the actual binding definition? I just don't understand what I'm seeing, here.

推荐答案

没有路径, {结合} 将绑定到的DataContext 本身。
加上路径将结合到的datacontext的属性

Without a path, {Binding} will bind to the DataContext itself.
Adding a path will bind to a property of the datacontext.

这篇关于这是什么'的ItemsSource =&QUOT; {结合}&QUOT;“意味着?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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