I would like to have a context menu which I can setup and open from basically anywhere in my C# code, so it should not be bound to a 'context' like a button or textbox.
My first idea was to use a window and apply a similar behaviour to it, like when clicking on the main window it closes. Would that be an option?
I've only found samples like this, where it's bound to a text box.
<TextBox Text="Text" Margin="25">
<MenuItem x:Name="MenuItem1">Menu Entry</MenuItem>