是否可以在UserControl中使用NavigateToScreenAction? [英] Is it possible to use a NavigateToScreenAction from within a UserControl?

查看:106
本文介绍了是否可以在UserControl中使用NavigateToScreenAction?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在UserControl中使用NavigateToScreenAction无济于事。

Attempted to use NavigateToScreenAction from within a UserControl to no avail.

即。 - 一个UserControl,里面有一个按钮,其中包含以下内容:

i.e. - a UserControl with a button inside of it that contains the following:

            < i:Interaction.Triggers>

    &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; < i:EventTrigger EventName =" MouseLeftButtonDown">

    &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; < pi:NavigateToScreenAction TargetScreen =" SilverlightPrototype5Screens.Screen2" />

    &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; < / i:EventTrigger>

    &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; < / i:Interaction.Triggers>

            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseLeftButtonDown">
                    <pi:NavigateToScreenAction TargetScreen="SilverlightPrototype5Screens.Screen2"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>

当UserControl置于Screen1中时,该按钮不起作用,虽然我可以在单击整个组件时使用NavigateToScreenAction。

When the UserControl is placed within Screen1, the button does not work, albeit I can use a NavigateToScreenAction when clicking on the entire component.

提示?

推荐答案

这是支持的,应该可行。我相信如果这是一个按钮,Button会出于自己的目的捕获MouseLeftButtonDown事件,请尝试使用"Click"。

This is supported and should work. I believe if this is on a button, Button captures the MouseLeftButtonDown event for its own purposes, try using "Click".

如果你还没有尝试过,那么组件就会出现在SketchFlow地图创建这样的用户控件,以便在多个屏幕中重复使用,并在SketchFlow中提供更好的支持,例如右键单击元素并选择"导航到 - >"。
这将设置相同的行为,但使用Click事件。

If you haven't tried it, the components feature in the SketchFlow map creates user controls like this for re-use in multiple screens, and has better support within SketchFlow, such as the ability to right click elements and select "Navigate to ->". This would set up that same behavior, but with the Click event.


这篇关于是否可以在UserControl中使用NavigateToScreenAction?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆