WPF popup with arrow head style
<p>I would like to implement a popup style that looks like the following design:</p>

<p><a href="https://i.stack.imgur.com/Z35q7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z35q7.png" alt="enter image description here"></a></p>

<p>The gray square represents the <code>UIElement</code> that shows the popup when it is clicked. The popup style is just a border (the easy part) with an arrow head that points to the center of the target element (the hard part). Also the aligment is important, when a control is placed on the right part of the window, the popup should be aligned to the right, otherwise to the left.</p>

<p>Is there an example or some documentation that instruct me how to proceed?</p>