This question is locked. New answers and comments are not allowed.
Hi!
I have extended the Resource class used in the ScheduleView to add a few properties.
Among them is ToolTip, a string property I use to create a more advanced multiline tooltip.
I group appointments by resources in the ScheduleView.
My group header for resources is a RadButton and looks like this:
As you can see I use ToolTipService.ToolTip at the bottom. And when I only set the content as above, binding it to the ToolTip property of my extended class, it works fine!
But now I want to include an Image inside the tooltip so I tried this:
But now, only the default tooltip with DisplayName will be shown.
I even tried just a simple TextBlock with a hard coded text, but it does not show up.
As soon as I use the ToolTip.Content tag instead of binding the content it fails.
What am I doing wrong?
Regards,
HÃ¥kan
I have extended the Resource class used in the ScheduleView to add a few properties.
Among them is ToolTip, a string property I use to create a more advanced multiline tooltip.
I group appointments by resources in the ScheduleView.
My group header for resources is a RadButton and looks like this:
<telerik:RadButton Background="{x:Null}" BorderBrush="{StaticResource Control_BorderBrush}" Command="{Binding EmployeeResourceCommand, Source={StaticResource ViewModel}}" CommandParameter="{Binding Name}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> <telerik:RadButton.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="14" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.Resources> <Style TargetType="TextBlock" BasedOn="{StaticResource DefaultTextBlock}"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="TextWrapping" Value="NoWrap" /> </Style> </Grid.Resources> <StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Left"> <TextBlock Text="*" FontWeight="Bold" Padding="5,0,0,0" Visibility="{Binding Name.IsModified, Converter={StaticResource VisibilityConverter}}" /> <TextBlock Text="{Binding Name}" FontWeight="{Binding Name.IsModified, Converter={StaticResource BooleanFontWeightConverter}}" Visibility="{Binding ShowSummary, Source={StaticResource ViewModel}, Converter={StaticResource VisibilityConverter}}" Padding="5,0,5,0" /> <TextBlock Text="{Binding Name}" FontWeight="{Binding Name.IsModified, Converter={StaticResource BooleanFontWeightConverter}}" Foreground="{Binding Name, Converter={StaticResource EmployeeResourceWorkTimeColorConverter}}" Visibility="{Binding ShowSummary, Source={StaticResource ViewModel}, Converter={StaticResource VisibilityConverter}, ConverterParameter='inverse'}" Padding="5,0,5,0" /> </StackPanel> <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Height="14" Margin="5,0,5,0" Visibility="{Binding ShowSummary, Source={StaticResource ViewModel}, Converter={StaticResource VisibilityConverter}}"> <TextBlock Text="{Binding Name.PlannedMinutes, Converter={StaticResource MinutesToTimeSpanConverter}}" Foreground="{Binding Name, Converter={StaticResource EmployeeResourceWorkTimeColorConverter}}" /> <TextBlock Text="/" Foreground="{Binding Name, Converter={StaticResource EmployeeResourceWorkTimeColorConverter}}" /> <TextBlock Text="{Binding Name.WorkTimeMinutes, Converter={StaticResource MinutesToTimeSpanConverter}}" Foreground="{Binding Name, Converter={StaticResource EmployeeResourceWorkTimeColorConverter}}" /> </StackPanel> <ToolTipService.ToolTip> <ToolTip Content="{Binding Name.ToolTip}" Style="{StaticResource MultiLine_ToolTip}" /> </ToolTipService.ToolTip> </Grid> </telerik:RadButton.Content> </telerik:RadButton>As you can see I use ToolTipService.ToolTip at the bottom. And when I only set the content as above, binding it to the ToolTip property of my extended class, it works fine!
But now I want to include an Image inside the tooltip so I tried this:
<ToolTipService.ToolTip> <ToolTip Style="{StaticResource MultiLine_ToolTip}"> <ToolTip.Content> <StackPanel Orientation="Vertical"> <Image Source="{Binding Name.Image, Converter={StaticResource ByteArrayToBitmapImageConverter}}" Height="32" Width="32" /> <TextBlock Text="{Binding Name.ToolTip}" /> </StackPanel> </ToolTip.Content> </ToolTip> </ToolTipService.ToolTip>But now, only the default tooltip with DisplayName will be shown.
I even tried just a simple TextBlock with a hard coded text, but it does not show up.
<ToolTipService.ToolTip> <ToolTip> <ToolTip.Content> <TextBlock Text="FOO" /> </ToolTip.Content> </ToolTip></ToolTipService.ToolTip>As soon as I use the ToolTip.Content tag instead of binding the content it fails.
What am I doing wrong?
Regards,
HÃ¥kan