Draw solid color triangle using XAML only

.NetWpfXamlDraw

.Net Problem Overview


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" />

.Net Solutions


Solution 1 - .Net

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

See API or Example.

Solution 2 - .Net

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" />

Solution 3 - .Net

Using paths

<Path Width="33" Height="37" Stretch="Fill" Stroke="Black" Fill="Black" Data="F1 M 319.344,237.333L 287.328,218.849L 287.328,255.818L 319.344,237.333 Z "/>
<Path Width="33" Height="37" Stretch="Fill" Stroke="Black" Fill="Black" Data="F1 M 287.328,237.333L 319.344,255.818L 319.344,218.849L 287.328,237.333 Z "/>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsllView Question on Stackoverflow
Solution 1 - .NetSpeziFishView Answer on Stackoverflow
Solution 2 - .NetVladimir TrifonovView Answer on Stackoverflow
Solution 3 - .NetLongZhengView Answer on Stackoverflow