我如何使用字符串作为索引来编译绑定或 x:Bind 到索引 属性?

How can I do compiled binding or x:Bind to indexed property using string as an index?

我正在尝试使用已编译的绑定 我有一个 属性 Errors,我曾经使用 {Binding Errors[PropertyName]} 等常规绑定进行绑定。但是,当我尝试使用 {x:Bind VM.Errors[PropertyName]} 时,出现了这个错误

"Invalid binding path 'VM.Errors[PropertyName]' : Expected a digit"

我也尝试使用像 VM.Errors['PropertyName'] 这样的引号,但它并没有解决问题。

它不起作用。微软写道:

{Binding Groups[2].Title}

Binds to the specified item in the collection. Only integer-based indexes are supported.

请参阅:https://msdn.microsoft.com/en-us/library/windows/apps/mt210946.aspx 页末。我曾尝试实施 IReadOnlyDictionary oe IDictionary,但没有成功。

这很有趣,因为在 https://msdn.microsoft.com/en-us/library/windows/apps/mt185586.aspx 他们说:

For example, consider a business object where there is a list of "Teams" (ordered list), each of which has a dictionary of "Players" where each player is keyed by last name. An example property path to a specific player on the second team is: "Teams1.Players[Smith]". (You use 1 to indicate the second item in "Teams" because the list is zero-indexed.)

更新

我在 Microsoft connnect 的支持案例已关闭。他们写道:

Thank you for reporting this issue as well as providing a sample project. The suggested scenario was not supported in Windows 10 RTM. We are however considering adding such support to a future update to Windows 10.