Problems with WPF ToolTipService properties (BetweenShowDelay, etc.) in Microsoft.Windows.Controls.Ribbon control

Unanswered Problems with WPF ToolTipService properties (BetweenShowDelay, etc.) in Microsoft.Windows.Controls.Ribbon control

  • Wednesday, August 15, 2012 7:12 PM
     
     

    Hello there,

    I have an very, very huge application in WPF with a Ribbon in it. The ribbon contain a bunch of RibbonControls, each binded to a different command. On every control, we put a ToolTip. We overrided these ToolTip templates to use a control of our own, which gives more information. We could call il a superToolTip.

    The override of the tooltip templates is working just fine. Now we want to unify the way the tooltips are showing. What I mean is we want the same initialShowDelay, ShowDuration, etc., for every single tooltips in the application (there are tooltips elsewhere than in the ribbon, which use the same home made control that the ones of the ribbon). So, I binded the ToolTipService.InitialShowDelay, ToolTipService.BetweenShowDelay, ToolTipService.ShowDuration properties to global constants in the application.

    InitialShowDelay :
    The property InitialShowDelay is working just fine for almost every control in the application... The only one not working is RibbonSplitButton, which keep the default value of 400...

    BetweenShowDelay :
    The property BetweenShowDelay is working just fine when the tooltip is on a ListBoxItem... but not working in the Ribbon nor in a complex control of our own (a Property Grid).

    These properties are set in the control on which the tooltip is set, and not on the tooltip themselves.

    I honestly have absolutely no idead why it is behaving this way... Anyone has any idea on what could cause this or how to solve it?

    If you need more information, do not hesitate to ask, i really am desperate about this.

    Thank you very much!

All Replies

  • Friday, August 17, 2012 9:30 AM
    Moderator
     
     

    Hi mgarant,

    What the InitialShowDelay and BetweenShowDelay like? And how did they work on your control in Ribbon? Please post some detail code here so that we can better help you find the root cause of this issue.

    Thank you.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • Friday, August 17, 2012 12:44 PM
     
      Has Code

    Here is some code showing how I implemented my ToolTips

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
    ...>
    ...
    <!-- Ribbon Tooltips Style -->
        <Style TargetType="ribbon:RibbonToolTip">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Utils:ToolTipControl DataContext="{Binding ToolTipInfo}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    ...
    <!-- RibbonControl -->
        <Style x:Key="RibbonControlStyle">
            <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="dummy" /><!-- Use dummy value to force tooltip to show -->
            <Setter Property="ToolTipService.InitialShowDelay" Value="{x:Static Utils:ToolTipViewModel.ToolTipInitialDelay}"/>
            <Setter Property="ToolTipService.ShowDuration" Value="{x:Static Utils:ToolTipViewModel.ToolTipShowDuration}"/>
            <Setter Property="ToolTipService.BetweenShowDelay" Value="{x:Static Utils:ToolTipViewModel.ToolTipBetweenShowDelay}"/>
            <!-- This style is used to select the "Editors" tab when opening Editor without a world, and to select the "Home" tab otherwise -->
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsWorldLoaded, Source={x:Static ViewModels:ViewportSettingsViewModel.Instance}}" Value="false">
                    <Setter Property="ribbon:Ribbon.SelectedIndex" Value="2"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding IsWorldLoaded, Source={x:Static ViewModels:ViewportSettingsViewModel.Instance}}" Value="true">
                    <Setter Property="ribbon:Ribbon.SelectedIndex" Value="0"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>


    • Edited by mgarant Friday, August 17, 2012 12:46 PM
    •  
  • Monday, August 20, 2012 8:34 PM
     
     
    Anyone?