Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controls:MetroWindow Question #1633

Closed
ghost opened this issue Nov 3, 2014 · 6 comments
Closed

Controls:MetroWindow Question #1633

ghost opened this issue Nov 3, 2014 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 3, 2014

Hi there is it possible to use a menu inside Controls:MetroWindow for a button so for example if user clicks Settings it will dropdown a menu like contextmenu strip?

@punker76
Copy link
Member

punker76 commented Nov 3, 2014

@nicotravassos maybe you mean #1603 it's in pipeline but i think not for 1.0

@ghost
Copy link
Author

ghost commented Nov 4, 2014

No is that is a pop over what i mean is it possible to have a menu strip kind of look when click button it will drop down a menu?

@thoemmi
Copy link
Collaborator

thoemmi commented Nov 4, 2014

I once implemented a Behavior for buttons: it opens the button's context menu on left-click. You can see the code here.

Usage:

<Button ToolTip="Tools and Options">
  <i:Interaction.Behaviors>
    <Infrastructure:ContextMenuOnLeftClickBehavior/>
  </i:Interaction.Behaviors>
  <Button.ContextMenu>
    <ContextMenu>
      <MenuItem Header="Settings" Command="{Binding ShowSettingsCommand}"/>
      <MenuItem Header="Check for updates" Command="{Binding ShowUpdatesCommand}" CommandParameter="{StaticResource TrueValue}"/>
      <MenuItem Header="About" Command="{Binding ShowAboutCommand}"/>
    </ContextMenu>
  </Button.ContextMenu>
</Button>

@ghost
Copy link
Author

ghost commented Nov 4, 2014

Thank you so much Exactly what i was looking for :)

@thoemmi
Copy link
Collaborator

thoemmi commented Nov 4, 2014

Glad I could help. Please close this issue then.

@ghost ghost closed this as completed Nov 4, 2014
@thoemmi
Copy link
Collaborator

thoemmi commented Sep 4, 2017 via email

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants