Binding to an index with space in XAML

If your addiction to data binding in XAML goes as far as to use indexers, eventually you may end up using a string with space (or other special character) as an index. Suppose, your index string is “[foo bar]” (square brackets are part of the string). This does not work:

{Binding MyCollection[[foo bar]].SomeField}

But this does:

{Binding MyCollection[[foo&x20;bar]].SomeField}

Posted in

Leave a Reply

Your email address will not be published. Required fields are marked *