Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw solid color triangle using XAML only

Tags:

.net

wpf

draw

xaml

Is it possible to draw a filled in triangle using XAML only (not a code behind solution)?

Triangle should be like on the image below to represent sort direction Ascending/Descending along with a sort button on a chart control:

enter image description here

EDIT: The solution, thanks to SpeziFish:

Ascending:

<Polygon Points="0,0 8,5, 0,10" Stroke="Black" Fill="Black" /> 

Descending:

<Polygon Points="8,0 0,5, 8,10" Stroke="Black" Fill="Black" /> 
like image 292
sll Avatar asked Oct 24 '11 11:10

sll


2 Answers

<Polygon Points="0,0 80,50, 0,100" Stroke="Black" Fill="Black" /> 

See API or Example.

like image 146
SpeziFish Avatar answered Oct 21 '22 17:10

SpeziFish


I want to add these to their collection:

enter image description here

    <Polygon Points="5,0 10,10, 0,10" Stroke="Black" Fill="Black" /> 

enter image description here

    <Polygon Points="0,0 5,10, 10,0" Stroke="Black" Fill="Black" /> 
like image 20
Vladimir Trifonov Avatar answered Oct 21 '22 15:10

Vladimir Trifonov