WPF数据绑定在绑定中指定数组索引无效

WPF数据绑定在绑定中指定数组索引无效,wpf,arrays,data-binding,indexing,Wpf,Arrays,Data Binding,Indexing,我在WPF中面临数据绑定问题: 以下代码正在运行: <TextBox Text="{Binding ProcessStepBlock.ProcessStep[2].ProcessDescription}"></TextBox> <TextBox Text="{Binding ProcessStepBlock.SelectedIndex}" ></TextBox> 下面的代码不起作用:它给了我一个绑定错误BindingExpression路

我在WPF中面临数据绑定问题:

以下代码正在运行:

<TextBox Text="{Binding ProcessStepBlock.ProcessStep[2].ProcessDescription}"></TextBox>
 <TextBox Text="{Binding ProcessStepBlock.SelectedIndex}" ></TextBox>


下面的代码不起作用:它给了我一个绑定错误BindingExpression路径错误:“[]”在“object''observeCollectionEx'1'上找不到属性。

 <TextBox Text="{Binding ProcessStepBlock.ProcessStep[ProcessStepBlock.SelectedIndex].ProcessDescription}"></TextBox>
 <TextBox Text="{Binding ProcessStepBlock.SelectedIndex}" ></TextBox>



请帮忙

XAML解析器无法解析属性以在PropertyPath中提供值。要获得您想要的内容,请使用一个同时接受ProcessStep集合和SelectedIndex属性的多重绑定,并创建一个IMultiValueConverter,通过在代码中进行索引来生成ProcessDescription。

感谢它的出色工作!!现在我意识到多重绑定在数据绑定中扮演着非常重要的角色。