I have WPF window with a FlowDocument with several hyperlinks in it:
<FlowDocumentScrollViewer>
<FlowDocument TextAlignment="Left" >
<Paragraph>Some text here
<Hyperlink Click="Hyperlink_Click">open form</Hyperlink>
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
In the C# code I handle Click event to create and show a new WPF Window:
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
if (sender is Hyperlink)
{
var wnd = new SomeWindow();
//wnd.Left = ???
//wnd.Top = ???
wnd.Show();
}
}
I need this window to appear next to hyperlink's actual position. So I assume it requires assigning values to the window's Left and Top properties. But I have no idea how to obtain hyperlink position.