locked
Scaled objects as tooltips RRS feed

  • Question

  • In 2.0 beta, I'm using a self-generated UIElement as a tooltip, which works just great.  However, if I try to scale the element with a ScaleTransform before assigning it as the tooltip, when the tooltip shows up, the tooltip area is still the original size of the UIElement even theough the UIElement HAS been scaled.  So either I end up with a bunch of extra tooltip canvas (if I scaled the element smaller) or not enough canvas (if I scaled it bigger).

     Is this a bug in the tooltip service, or am I doing something wrong?  I guess I could roll my own tooltip here, but I'd rather use the tooltip service if possible.

     Jamie

    Wednesday, April 9, 2008 2:13 AM

Answers

  • Hello, this is because you're setting a ScaleTransform on the child of a Border, which doesn't affect the Border itself. This behavior is consistent with WPF. You should wrap your root element of the ToolTip inside a specific ToolTip tag, and set the ScaleTransform on the ToolTip instead of the child element.

    Thursday, April 10, 2008 11:54 PM

All replies

  • Hello, this is because you're setting a ScaleTransform on the child of a Border, which doesn't affect the Border itself. This behavior is consistent with WPF. You should wrap your root element of the ToolTip inside a specific ToolTip tag, and set the ScaleTransform on the ToolTip instead of the child element.

    Thursday, April 10, 2008 11:54 PM
  • Ok, I will try that solution.  Thanks!

    Friday, April 11, 2008 1:38 PM
  • Applying the ScaleTransform to the ToolTip border itself works, but now the tool-tip does not display in a consistent location to its parent object.  Is there a way to scale the tooltip without chaning its relative position to the parent object?  ToolTipService seems to be locating the tooltip based on its original size, not the scaled size.  You can alter the TranformOrigin point, but because you don't know if the tool tip is going to display to the left, right, top, or bottom of the object, you can't seem to set the origin point properly. 
    Saturday, April 26, 2008 9:55 PM
  • Hmmm, Beta 2 seems to have removed the ToolTip tag.  Does this mean there is now no way to scale a tooltip object?

     

    Sunday, June 8, 2008 1:45 AM