tags:

views:

735

answers:

1

I have a list box that displays items based on an xpath.

This xpath changes depending on user selection elsewhere in the gui. The xpath always refers to the same document.

At the moment i use some c# code behind to change the binding of the control to a new xpath expression.

I'd like instead to bind in xaml to an xpath and then change the value of that xpath as required.

How would i do that?

+2  A: 

I think that you're trying to over complicate the problem. But have you thought about allocating the XPath to a dynamic resource:

<.... ={Binding XPath={DynamicResource:res resource-name}} ... />

The best place to read about all-binding is Beatriz's blog: http://www.beacosta.com/blog/

IgorM