Drawing an arrow using XAML

I do not know how to draw an arrow using XAML. I don’t have a code at the moment.

Can anyone help me make this draw with XAML code?

Thank you for your help.

+6
source share
2 answers

You can use TextBlock ( http://xahlee.info/comp/unicode_arrows.html )

 <TextBlock Text="&#x2794;" /> 

Or Path ( https://msdn.microsoft.com/en-us/library/system.windows.shapes.path%28v=vs.110%29.aspx )

 <Path Stroke="Black" Data="M 0 4 L 16 4 L 10 0 M 16 4 L 10 8" /> 
+12
source

I simply draw one point of the workpiece manually and adjust the point with my eyes:

 <Path Stretch="Fill" Fill="LimeGreen" Data="M 0,115 95,115 //p1, p2 (when really use remove these comments) 65,90 85,90 //p3, p4 120,120 //p5 85,150 65,150 //p6, p7 95,125 0,125 //p8, p9 Z" HorizontalAlignment="Center" Width="60" Height="60" /> 

You can adjust the width / height, basically p1,p2,p3,p4 and p6,p7,p8,p9 are symmetrical, and Data can omit the description and comma as follows:

 Data="M 0 115 95 115 65 90 85 90 120 120 85 150 65 150 95 125 0 125 Z" 

Result:

enter image description here

In addition, the arrow rotation method is shown here, the example below rotates the other arrow to the right by 180 degrees, becoming the left arrow:

  <Path Stretch="Fill" Fill="LimeGreen" Data="M 0,110 70,110 45,90 75,90 120,120 75,150 45,150 70,130 0,130 Z" HorizontalAlignment="Right" Width="30" Height="24" Margin="0,0,2,0" RenderTransformOrigin=".5,.5"> <Path.RenderTransform> <RotateTransform Angle="180" /> </Path.RenderTransform> </Path> 
+7
source

Source: https://habr.com/ru/post/987979/


All Articles