我将我的PDFDocument绑定到FlowDocumentScrollViewer。
<FlowDocumentScrollViewer
Document="{Binding Path=PDFDocument}"
/>
如何在查看区域内的文本框中添加新的上下文菜单项
答案 0 :(得分:0)
最终我找到了怎么做 您可以使用如下样式属性设置器将上下文菜单附加到每个TextBox Elements:
<Window.Resources>
<ContextMenu x:Key="contextMenu" >
<MenuItem Name="mnuOpen" Header="_Open Link" Command="{Binding TextBoxContextMenuCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>
<MenuItem Name="mnuView" Header="_View Properties" Command="{Binding TextBoxContextMenuCommand}"/>
</ContextMenu>
<Style TargetType="TextBox">
<Setter Property="ContextMenu" Value="{DynamicResource contextMenu}" />
</Style>
</Window.Resources>