Dienstag, 13. August 2013

How to show a tooltip only if the element/target is disabled/is not enabled ...

<button click="myButton_Click_1" content="Testtext" isEnabled="{Binding myButtonIsEnabledState}" name="myButton"
ToolTip="{Binding disabledStateToolTipText}" ToolTipService.isEnabled="{Binding Source={x:Static ProjectNamespace:App.isNotRegistered}}" ToolTipService.showOnDisabled="True"> </button>
The Default behavior is to Switch off the ToolTip via ToolTipService.isEnabled +++ The ToolTip will only be active, if the Button is not enabled using ToolTipService.IsEnabled property, because ToolTipService.showOnDisabled="True" overrides the previous "false"-ToolTip functionality.

myButtonIsEnabledState = true or false ViewModel Member for basic button on/off  

disabledStateToolTipText = text to show as a tooltip

App.isNotRegistered = here global static true/false-Switch to modify the tooltip visibility

Benefit from the best Windows Desktop app in the world and use Strokey.Net!

Keine Kommentare:

Kommentar veröffentlichen