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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luming

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

    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.XmlA ttribute . If I bind the
    same attribute to Button.ToolTip, I can get correct string.

    Anyone here can help me out? Thanks in advance.


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: How to assign string to WPF Button.Tag by using XPath

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Luming" <Lum.wang@gmail .comwrote in message
    news:a23efb34-f2bb-4270-a5eb-3f91cfb627df@e1 0g2000prf.googl egroups.com...
    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.XmlA ttribute . If I bind the
    same attribute to Button.ToolTip, I can get correct string.
    >
    Anyone here can help me out? Thanks in advance.
    >
    >

    Comment

    Working...