开发者

Context Menus and NavigateTo in Blend / SketchFlow

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开发者_JAVA技巧_3_2"/>
   </i:EventTrigger>
  </i:Interaction.Triggers>
 </MenuItem>
</ContextMenu>


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>


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜