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

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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

Top