Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
XamScreenTip binding to ButtonTool command

I would like to bind the text of XamScreenTips to a sting in the command for the related ButtonTool. This will allow me to display messages in the screen tip when a user rolls over a disabled button that would explain why it is disabled (ie: 'You need admin permissions to use this').

I am using an ICommand with a DisabledMessage string for the command of the ButtonTools. I also took the default XamScreenTip control template and build upon it to add styling and triggers to hide the footer when a button is enabled. Is there a way from within the XamScreenTip control template to reference the related ButtonTool and its command string?

  • 54937
    Suggested Answer
    Offline posted

    XamScreenTip is a derived ToolTip that adds footer/header functionality so it doesn't provide any additional binding facility that anything else might this easier/harder. Essentially a ToolTip is not within the logical/visual tree of the element for which it's being shown so you cannot use element name binding. One thing that you could try though is to bind to a property of the PlacementTarget of the tooltip. e.g.

    <igRibbon:ButtonTool Caption="ABC">
                Content="This is a tooltip" 
                Header="{Binding RelativeSource={RelativeSource Self}, 
                Path=PlacementTarget.Caption}" />

    Note, depending on how the command & binding is set up it is possible this could lead to a memory leak so you may want to refer to the following MS page and use a profiler to ensure that things are being released as they need to be.