locked
WPF tooltip on touchscreen RRS feed

  • Question

  • Hi,

    I am having problem with implementing tooltips in WPF application on touchscreen.

    I use IDataErrorInfo  in conjunction with textbox style.

    <Style.Triggers>
       
    <Trigger Property="Validation.HasError" Value="true">
           
    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"></Setter>
       
    </Trigger>
    </Style.Triggers>

    Everything works fine.

    The problem is that on touchscreen it is very hard to do roll mouse cursor over the text box to trigger showing the tooltip. The ideal solution would be to show tooltip on the control on GotFocus instead of MouseOver event. Alternatively I would be OK to launch the tooltip displaying explicitly from code behind.

    But I do not see any way if achieving this. All information I found is about how to update tooltip content but not how to control tooltip behavior. Am I missing something.

    Any suggestion would be appreciated...

    Taras
    Friday, September 5, 2008 12:47 AM

Answers

  • Well, that's a bummer indeed, you could try ToolTip.IsOpened read/write properties instead, I always think that the attached properties provided by ToolTipService is functionally equivalent to those provided by ToolTip:)

    Thanks
    • Marked as answer by Marco Zhou Friday, September 12, 2008 9:37 AM
    Thursday, September 11, 2008 3:08 AM

All replies

  • -> Alternatively I would be OK to launch the tooltip displaying explicitly from code behind.

    Does explicitly setting ToolTipService.IsOpenProperty attached property as follows helps with your scenario?

    textBox.SetValue(ToolTipService.IsOpenProperty, true);

    Thanks
    Monday, September 8, 2008 7:49 AM
  • ...sorry for the late response...

    Thank you Marko,

    I appreciate your response.

    Sounds promising but when I set this property I have the following exception:

    'IsOpen' property was registered as read-only and cannot be modified without an authorization key.

    Is there any way to overcome this?

    Thanks,
    Taras

    Thursday, September 11, 2008 12:28 AM
  • Well, that's a bummer indeed, you could try ToolTip.IsOpened read/write properties instead, I always think that the attached properties provided by ToolTipService is functionally equivalent to those provided by ToolTip:)

    Thanks
    • Marked as answer by Marco Zhou Friday, September 12, 2008 9:37 AM
    Thursday, September 11, 2008 3:08 AM