aybe
aybe

Reputation: 16652

Bind ToolTip.Content to a ProgressBar.Value in a DataTemplate

Tried many ways like defining the binding as RelativeSource=TemplatedParent, RelativeSource=FindAncestor, TemplateBinding and even ControlTemplate but the ToolTip remains blank.

Note: not looking for a direct binding to a Path property since the template will feature many progress bars.

    <DataTemplate DataType="{x:Type echoNestModel:dboAudioSummary}">
        <DataTemplate.Resources>
            <Style TargetType="ProgressBar" >
                <Setter Property="Maximum" Value="1" />
                <Setter Property="ToolTip">
                    <Setter.Value>
                        <ToolTip>
                            <TextBlock Text="{TemplateBinding RangeBase.Value}" />
                        </ToolTip>
                    </Setter.Value>
                </Setter>
            </Style>
        </DataTemplate.Resources>
    </DataTemplate>

Upvotes: 0

Views: 1252

Answers (1)

brunnerh
brunnerh

Reputation: 184286

How about:

<Setter Property="ToolTip" Value="{Binding Value, RelativeSource={RelativeSource Self}}">

Upvotes: 2

Related Questions