Can annotations be used in a WPF RichTextBox? Context menu items are disabled?

joe blow 1 Reputation point
2022-07-15T01:06:27.843+00:00

Can flowdocument annotations being used in a WPF RichTextBox. I tried using the annotation CreateTextStickyNoteCommand but the menu items is disables when running the code

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
765 questions
{count} votes

1 answer

Sort by: Most helpful
  1. joe blow 1 Reputation point
    2022-07-15T18:35:14.01+00:00

    I know that.
    The link you provided me I been to as is worthless
    I am add the Annotation Create and Delete stick not commands
    The corresponding menu items appear disabled at runtime

    <RichTextBox.ContextMenu>
    <ContextMenu>

                                        <MenuItem  
              Command="annotations:AnnotationService.CreateTextStickyNoteCommand"  
              Header="Add Text Note" />  
                                        <!-- Command to Delete an Existing Text Note -->  
                                        <MenuItem  
              Command="annotations:AnnotationService.DeleteStickyNotesCommand"  
              Header="Remove Text Note" />  
                                    </ContextMenu>  
                                </RichTextBox.ContextMenu>
    
    0 comments No comments