Amibluesky
Amibluesky

Reputation: 189

Expand / Reduce symbol in TextBlock WPF/Xaml

I have a Simple tooltip that contains some informations,

I want to add an Expand button (located on the top right corner of the tooltip, In a TextBlock) that allows (by click) the display of an Advanced ToolTip ,

When this advanced tooltip is displayed and When clicking on the reduce button (located on the top right corner), the simple tooltip is displayed back.

How can i represent these two symbols (enter image description here and enter image description here) in my textblock in order to expand/Reduce ?

Upvotes: 0

Views: 81

Answers (1)

dymanoid
dymanoid

Reputation: 15227

To draw custom shapes in WPF, use the Path element:

<StackPanel Orientation="Vertical">
    <Path StrokeThickness="3" Stroke="Black" 
        Data="M 30,10 L 90,10 L 90,70 M 10,30 L 70,30 L 70,90 M 10,90 L 70,30"/>
    <Path StrokeThickness="3" Stroke="Black" 
        Data="M 30,10 L 90,10 L 90,70 M 10,30 L 10,90 L 70,90 M 10,90 L 70,30"/>
</StackPanel>

The Data property can be used to describe a shape using a special path markup.

Here is the result of this markup:

screenshot

You can customize the arrows as you wish by changing the Data property.

Upvotes: 1

Related Questions