Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Styling Comparitive Measures
posted

I would like to add a tooltip to a bullet charts measures so I have modified the template to include a tooltip, however I get an error when registering the resource. This seems to be caused by the bindings, any idea why this is occurring?

    <Style x:Key="FeaturedMeasureStyle" TargetType="igGuage:FeaturedMeasure">
        <Setter Property="Value" Value="{Binding Path=DblValue}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="igGuage:FeaturedMeasure">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Stroke}" BorderThickness="{TemplateBinding BorderThickness}">

                        <ToolTipService.ToolTip>
                                <Border BorderBrush="{StaticResource WidgetSubtleForegroundBrush}" Background="White" Margin="-10" BorderThickness="1.0" CornerRadius="5" >
                                    <Border.Effect>
                                        <DropShadowEffect BlurRadius="5" Color="Black" Opacity="0.5" />
                                    </Border.Effect>
                                    <Grid Margin="5" >
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>

                                    <TextBlock Text="{Binding Caption}" Grid.Row="0" Margin="2,2,5,2" />
                                    <TextBlock Text="{Binding FormattedValue}" Grid.Row="1" Margin="2" FontWeight="Bold" />
                                    </Grid>
                                </Border>
                        </ToolTipService.ToolTip>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>