0

I am using the BindableDynamicDictionary with much success. However, the column names (the keys in the bindable dynamic dictionary) are coming from another program which allows HTML tags and such. Is there any way to escape / ignore those characters without removing them?

I am getting this:

System.Windows.Data Error: 17 : Cannot get '<b>Filling<' value (type 'Object') from '' (type 'BindableDynamicDictionary'). BindingExpression:Path=<b>Filling</b>; DataItem='BindableDynamicDictionary' (HashCode=52143524); target element is 'ValueHolder' (HashCode=10973391); target property is 'Value' (type 'Object') InvalidOperationException:'System.InvalidOperationException: Property path is not valid. 'System.Dynamic.DynamicObject+MetaDynamic' does not have a public property named 'Items'.

As you can see, the issue is here:

BindingExpression:Path=<b>Filling</b>

It ends up trying to look up this in the dictionary:

<b>Filling<

Any help greatly appreciated.

Community
  • 1
  • 1
Jon Heaton
  • 252
  • 3
  • 12

1 Answers1

0

This page had the information I needed to resolve this issue, particularly the section "Escapes for Property Path Strings".

Since I was using a dictionary as my DataSource, using the indexers ([]) was properly "escaping" the HTML characters. I did find that even characters like '.' and '/' were causing the binding to fail since those characters have meaning in the XAML parser.

Jon Heaton
  • 252
  • 3
  • 12