In the XAML I created a popup:
<Popup Name="PopupWindow" Placement="Mouse" IsOpen="False" StaysOpen="False" Opened="PopupWindow_Opened">
<Border Width="100" Height="100" Background="AntiqueWhite">
<Label Name="myLabel" Content="Hello World!" />
</Border>
</Popup>
In the code behind, in the OnMouseClick()
event handler:
var position = e.GetPosition(mainPanel);
PopupWindow.IsOpen = true;
However I do not know how to get a reference to myLabel
in order to update the value, since it is created inside the XAML directly.