Using with 3rd Party Libraries

Topics: question
Dec 29, 2009 at 3:39 PM

Is there a way to force a 3rd party library (or all created ToolTips) to use this extension instead of the Silverlight default?  Specifically, I'm using the Infragistics charting libraries and don't have access to the actual UIElements that are registering the ToolTips (individual bars of a chart) and need them to use this library.

Coordinator
Dec 30, 2009 at 3:35 PM

Hi,

indeed that is a good question, and from that perspective, it really is my wish to see an out-of-the-box solution in a next version of Silverlight. They are aware of my workaround solution, so there is hope..

For now, if you are using any third party library (such as Infragistics), I'd say you'll have to override the elements Control Template if you want to use my custom ToolTipService instead of the default Silverlight one.

At least, that's how I did it for a customer that had the initial request for having this custom tooltip behavior (customer used Telerik third party libraries).

I'd say, give it a try and keep me posted ;-)

Best regards,

Xavier

Jun 15, 2011 at 4:51 PM

HI Xavier i am using your ToolTips Control in Telerik SchedulerView Control and this what i have done

 <ControlTemplate x:Key="ToolTipTemplate" TargetType="Controls:ToolTip">
        <Grid Background="Transparent">
            <!--  <ToolTipService.ToolTip> -->
            <Controls:ToolTipService.ToolTip>
                <Controls:ToolTip DisplayTime="00:05:00" InitialDelay="00:00:00" x:Name="appointmentTooltip">
                    <Controls:ToolTip.Content>
                        <Border CornerRadius="2" MaxWidth="350" >
                            <Grid Margin="3,8,0,15">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition  Width="45"/>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Border Grid.ColumnSpan="2" VerticalAlignment="Top" BorderBrush="#FF417542" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" HorizontalAlignment="Left">
                                    <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1">
                                        <TextBlock Text="{Binding Path=Appointment.Subject}" TextWrapping="Wrap"  FontWeight="Bold" Margin="5,0,5,0" />
                                    </Border>
                                </Border>
                                <Image Grid.Row="1"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5 5 0 0" Source="../../Images/clock.png" Width="28" Height="29" />
                                <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1" Margin="0 5 0 0">
                                    <TextBlock Text="{Binding Path=Appointment.Start, StringFormat='dddd dd MMM yyyy'}" Margin="0 3" FontSize="10" />
                                    <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                                        <TextBlock Text="{Binding Path=Appointment.Start, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="10" />
                                        <TextBlock Text=" - " FontSize="10" />
                                        <TextBlock Text="{Binding Path=Appointment.End, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="10" />
                                    </StackPanel>
                                    <TextBlock Text="{Binding Path=Appointment.Location}" TextWrapping="Wrap" FontSize="10" />
                                </StackPanel>
                                <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="{Binding Path=Appointment.Body}" Margin="5 3 5 8" TextWrapping="Wrap"  />
                            </Grid>
                        </Border>
                    </Controls:ToolTip.Content>
                </Controls:ToolTip>
            </Controls:ToolTipService.ToolTip>
            <!--   </ToolTipService.ToolTip> -->
            <TextBox Margin="7 0 5 0" VerticalAlignment="Top"  HorizontalAlignment="Stretch"
                                                          Text="{Binding Path=Appointment.Subject}" 
                                                          IsHitTestVisible="False" 
                                                          Foreground="Black" TextWrapping="Wrap"  Background="Transparent"  BorderThickness="0" Style="{StaticResource AppointmentSubjectTextBox}"  />
        </Grid>
    </ControlTemplate>

Is this right way to go ?

Please advise

 

Thanks

Ronak

Coordinator
Jun 15, 2011 at 6:03 PM
Hi Ronak,

At first sight, that looks correct to me.
I do hope the Telerik internals don't try to manipulate it based on the Silverlight built-in ToolTipService classes.
Let me know how it turns out ;-)

Cheers,
Xavier

2011/6/15 ronakce <notifications@codeplex.com>

From: ronakce

HI Xavier i am using your ToolTips Control in Telerik SchedulerView Control and this what i have done

 <ControlTemplate x:Key="ToolTipTemplate" TargetType="Controls:ToolTip">
        <Grid Background="Transparent">
            <!--  <ToolTipService.ToolTip> -->
            <Controls:ToolTipService.ToolTip>
                <Controls:ToolTip DisplayTime="00:05:00" InitialDelay="00:00:00" x:Name="appointmentTooltip">
                    <Controls:ToolTip.Content>
                        <Border CornerRadius="2" MaxWidth="350" >
                            <Grid Margin="3,8,0,15">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition  Width="45"/>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Border Grid.ColumnSpan="2" VerticalAlignment="Top" BorderBrush="#FF417542" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" HorizontalAlignment="Left">
                                    <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="1,1,1,1">
                                        <TextBlock Text="{Binding Path=Appointment.Subject}" TextWrapping="Wrap"  FontWeight="Bold" Margin="5,0,5,0" />
                                    </Border>
                                </Border>
                                <Image Grid.Row="1"  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5 5 0 0" Source="../../Images/clock.png" Width="28" Height="29" />
                                <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1" Margin="0 5 0 0">
                                    <TextBlock Text="{Binding Path=Appointment.Start, StringFormat='dddd dd MMM yyyy'}" Margin="0 3" FontSize="10" />
                                    <StackPanel Orientation="Horizontal" Margin="0 0 0 0">
                                        <TextBlock Text="{Binding Path=Appointment.Start, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="10" />
                                        <TextBlock Text=" - " FontSize="10" />
                                        <TextBlock Text="{Binding Path=Appointment.End, StringFormat='hh:mm tt'}" TextWrapping="Wrap" FontSize="10" />
                                    </StackPanel>
                                    <TextBlock Text="{Binding Path=Appointment.Location}" TextWrapping="Wrap" FontSize="10" />
                                </StackPanel>
                                <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="{Binding Path=Appointment.Body}" Margin="5 3 5 8" TextWrapping="Wrap"  />
                            </Grid>
                        </Border>
                    </Controls:ToolTip.Content>
                </Controls:ToolTip>
            </Controls:ToolTipService.ToolTip>
            <!--   </ToolTipService.ToolTip> -->
            <TextBox Margin="7 0 5 0" VerticalAlignment="Top"  HorizontalAlignment="Stretch"
                                                          Text="{Binding Path=Appointment.Subject}" 
                                                          IsHitTestVisible="False" 
                                                          Foreground="Black" TextWrapping="Wrap"  Background="Transparent"  BorderThickness="0" Style="{StaticResource AppointmentSubjectTextBox}"  />
        </Grid>
    </ControlTemplate>

Is this right way to go ?

Please advise

Thanks

Ronak

Read the full discussion online.

To add a post to this discussion, reply to this email (tooltipservice@discussions.codeplex.com)

To start a new discussion for this project, email tooltipservice@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jul 15, 2011 at 5:58 PM

Hello Xavier,

well this is not working in case of Telerik RadScheduleView Control but it used to work in radScheduler Control.They also told me setting ToolTipTemplate Property of ScheduleView Control to x:null cancel microsoft toolTip and i can use third party but its not working

Basically a RadScheduleView Control is newer version of RadScheduler Control which will eventually go away so i need to upgrade to new Control everything working except the default ToolTip behaviour which i want to have around 5 min.

do you have any inside ?

 

Thanks

Ronak