The copy test command Copy (in Button) is connected via Command with ApplicationCommands.Copy
How to invoke the command Command = "Copy" from ContextMenu Click?
Click Attempts to find a command in Window1 and not in ApplicationCommands.Copy.
Severity Code Description Project File String Suppression State Error CS1061 'Window1 "does not contain a definition for" Copy "and could not find the" Copy "extension method that accepts the type" Window1 "as the first argument (possibly using a directive or a link to the assembly) . \ Window1.xaml 1365 Active
<Button Command="Copy"> <Button.ToolTip> <ToolTip > <StackPanel> <TextBlock /> </StackPanel> </ToolTip> </Button.ToolTip> </Button> CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, OnCopy, CanCutOrCopy)); TextAreaDefaultInputHandler.WorkaroundWPFMemoryLeak(InputBindings); <ContextMenu> <MenuItem Click="Copy"> </MenuItem> </ContextMenu>