I want to make a tooltip with multibinding inside a text block, but whatever I try it doesn't work.
Here is what I've tried so far:
<TextBlock Text="{Binding Description, StringFormat='Description : {0}{}'}">
    <ToolTipService.ToolTip>
        <TextBlock>
            <TextBlock.Text>
                <MultiBinding StringFormat="Description : {0}{1}{}">
                    <Binding Path="FirstDescription" />
                    <Binding Path="SecondDescription" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </ToolTipService.ToolTip>
</TextBlock>
But when I try it, what I see on the tooltip is : System.Windows.Controls.TextBlock.
when i try it without tooltipservice, and only tooltip, like this :
<TextBlock Text="{Binding Description, StringFormat='Description : {0}{}'}">
    <ToolTip>
        <TextBlock>
            <TextBlock.Text>
                <MultiBinding StringFormat="Description : {0}{1}{}">
                    <Binding Path="FirstDescription" />
                    <Binding Path="SecondDescription" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </ToolTip>
</TextBlock>
The screen just get stuck.
I dont't know wich VS version you are using but:
<TextBlock Text="{Binding Description, StringFormat="Description : {0}{}"}">
does not even compile for me.
Just remove the " and the empty brackets like that:
<TextBlock Text="{Binding Description, StringFormat=Description : {0}">
You could also write it like this if you want the ":
<TextBlock>
    <TextBlock.Text>
        <Binding Path="Description" StringFormat="Description : {0}" />
    </TextBlock.Text>
    <ToolTipService.ToolTip>
        <TextBlock>
                    <TextBlock.Text>
                        <MultiBinding StringFormat="Description : {0}{1}">
                            <Binding Path="FirstDescription" />
                            <Binding Path="SecondDescription" />
                        </MultiBinding>
                    </TextBlock.Text>
        </TextBlock>
    </ToolTipService.ToolTip>
</TextBlock>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With