How to assign string to WPF Button.Tag by using XPath

  • Thread starter Thread starter Luming
  • Start date Start date
L

Luming

Guys, I am trying to bind Button.Tag property to a XPath value by
using < Button tag="{Binding XPath=@attr}" /> . However, this tag
attribute always get value - System.Xml.XmlAttribute . If I bind the
same attribute to Button.ToolTip, I can get correct string.

Anyone here can help me out? Thanks in advance.
 
Luming,

When you use the XPath with the appropriate XPath expression, it is
returning a node to you in this case. This node is an attribute node, not
the value itself. You have to set the Path property of the Binding to the
property on the XmlAttribute that you want to display.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Binding XML Data to WPF 1
XmlDocument and Xpath 5
XPath question 2
Error in Xpath 3
C# linq ToDictionary 6
XPath get max value 5
updating xcml config file with treeView nodes 1
Getting single treeview node by path 2

Back
Top