2

I have a binding in XAML:

{Binding XPath=List/Item[@Status='OK']}

Visual Studio tells me it's expecting ' and } but when I look at documentation elsewhere, it seems this line looks fine. It won't compile and gives me an error saying that the member List/Item[@Status='OK'] is not accessible.

What am I doing wrong?

Audio
  • 307
  • 1
  • 4
  • 14

1 Answers1

0

To fix the problem, try to escape the entire XPath expression with quotes, and escape quotes inside XPath using " :

{Binding XPath='List/Item[@Status="OK"]'}

Or another option, escape equals sign and single quotes using backslash :

{Binding XPath=List/Item[@Status\=\'OK\']}

References :

Community
  • 1
  • 1
har07
  • 88,338
  • 12
  • 84
  • 137