I have a WPF window with a FlowDocument with a few hyperlinks in it:
<FlowDocumentScrollViewer>
<FlowDocument TextAlignment="Left" >
<Paragraph>Some text here
<Hyperlink Click="Hyperlink_Click">open form</Hyperlink>
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
In C # code, I handle the Click event to create and display a new WPF window:
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
if (sender is Hyperlink)
{
var wnd = new SomeWindow();
wnd.Show();
}
}
I need this window to appear next to the actual position of the hyperlink. Therefore, I assume that for this it is necessary to assign values to the Left and Top properties of the window. But I do not know how to get the position of the hyperlink.
source
share