3

Hoping this will be a simple one, in Sketchflow i'm trying to wire up a context menu to navigate to another page.

I've created the context menu, added a menu item, right clicked the mneu item in the Objects and Timeline panel and selected navigateto. When i run it, the menu comes up but when i click on the menu item it doesn't do anything.

I previously had the NavigateTo working when left clicking on another object, so the screens / connections are all in place.

This is the xaml that was generated:

    <ContextMenu>
 <MenuItem Header="Edit">
  <i:Interaction.Triggers>
   <i:EventTrigger EventName="MouseDown">
    <pb:NavigateToScreenAction TargetScreen="SomeScreen.Screen_3_2"/>
   </i:EventTrigger>
  </i:Interaction.Triggers>
 </MenuItem>
</ContextMenu>
Spruce
  • 282
  • 3
  • 13

2 Answers2

3

This xaml works for the scenario I think you are trying to achieve:

<Button Content="Button">
            <Button.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Next">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <pb:NavigateToScreenAction TargetScreen="WpfPrototype3Screens.Screen_2"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </MenuItem>
                </ContextMenu>
            </Button.ContextMenu>
        </Button>
Chuck Hays
  • 1,194
  • 1
  • 6
  • 7
  • 1
    *sigh* I don't know why the Expression Engine sets EventName to "LeftMouseClickDown" but this fixed my issue. I guess the engine defaults to the most specific case, rather that the most general. Thanks. – JohnMetta Dec 18 '10 at 16:15
1

As long as the path for the TargetScreen is correct, just change the EventName to "Click" and it will work. "Click" handles the "MouseDown" event.

Adam Kinney
  • 1,075
  • 7
  • 5