Hi Sfernandes and thanks a lot for helping with this.
Unfortunately I did not manage to get this thing to work.
Here is my TooltipHelper class
public class ToolTipHelper : DependencyObject
{
public static bool GetTooltipHandler(DependencyObject obj)
{
return (bool)obj.GetValue(EnableToolTipHandlerProperty);
}
public static void SetTooltipHandler(DependencyObject obj, bool value)
{
obj.SetValue(EnableToolTipHandlerProperty, value);
}
public static DependencyProperty EnableToolTipHandlerProperty = DependencyProperty.RegisterAttached(
"EnableToolTipHandler", typeof(bool), typeof(ToolTipHelper),
new PropertyMetadata(true, OnEnableToolTipHandler));
private static void OnEnableToolTipHandler(object sender, DependencyPropertyChangedEventArgs e)
{
FrameworkElement element = sender as FrameworkElement;
if (element != null)
{
element.ToolTipOpening += OnToolTipOpening; // this could be a handler from any known instance
}
}
public static void OnToolTipOpening(object sender, ToolTipEventArgs e)
{
#if UNITY
Debug.Log("ToolTip is opening...");
#endif
}
}
and here is my Togglebutton xaml
<ToggleButton ... helper:ToolTipHelper.TooltipHandler="True" ... />
And the result is...nothing, no error, no warnings, nothing.
I placed some break points in my TooltipHelper class but nothing ever gets fired.
Do you have any idea what could be the problem here?
Edit:
Actually there is one warning generated by Noesis:
[dx9] Assets/GloryAssets/Cok_Xaml/Editors/UserControls/EquipmentEditorWindow.xaml
Ignoring unknown member Assets.GloryAssets.Scripts.GUI.XamlHelpers.ToolTipHelper.TooltipHandler (@219,104)