Eamonn McEvoy
Eamonn McEvoy

Reputation: 8986

Is it possible to put a user control into a context menu

I don't know if this is possible but does anyone know if there is a way to put a user control inside a context menu, I have a dialog for adding items to a list but I would like when I click the add button for the control to be displayed in the context menu instead. (dont like having a lot of dialog's in my app).

Here is what I tried but it doesn't work:

<Button  Grid.Column="2" Grid.Row="1" Content="Add Item" HorizontalAlignment="Right">
    <Button.ContextMenu>
        <ContextMenu>
            <MenuItem>
                <vm:MyControlView/>
            </MenuItem>
        </ContextMenu>
    </Button.ContextMenu>
</Button>

Is there a way to achieve this? (or something similar)

Upvotes: 2

Views: 796

Answers (1)

piebie
piebie

Reputation: 2672

You could try this link, it looks like you might be able to extend ContextMenu like John Dunn did to meet your needs.

Upvotes: 1

Related Questions