This is a migrated thread and some comments may be shown as answers.

Set RadToolTipService properties globally

1 Answer 91 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Wetzorke
Top achievements
Rank 1
Wetzorke asked on 04 Sep 2017, 09:11 AM
Hello,

as mentioned in the title, I would like to set some of RadToolTipServices' properties globally. I tried to set them as follows:
<Style x:Key="RadToolTipStyle" TargetType="telerik:RadToolTip">
    <Setter Property="Placement" Value="Top"/>
    <Setter Property="HorizontalOffset" Value="10"/>
    <Setter Property="VerticalOffset" Value="10"/>
    ...
</Style>
<Style TargetType="telerik:RadToolTip" BasedOn="{StaticResource RadToolTipStyle}"/>
but this had no effect on the positioning. Do I have to set those properties elsewhere or is this a bug?
Currently, I got the desired result by adjusting the margin in the template.

Best regards

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 07 Sep 2017, 09:03 AM
Hi Bernd,

Thank you for your interest in RadToolTip control.

The implicit style is not working because the properties of the RadToolTip are for per control not for per RadToolTip. That means that setting in style will not work. To change the Placement, HorizontalOffset,  etc. properties globally you can either set the attached properties to every control in your application or override their default value using OverrideMetadata() method. Check the following code snippet.
static MainWindow()
{
    RadToolTipService.PlacementProperty.OverrideMetadata(typeof(FrameworkElement), new PropertyMetadata(System.Windows.Controls.Primitives.PlacementMode.Top));
}


Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ToolTip
Asked by
Wetzorke
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or