我是Blend& amp;的新手SketchFlow的。我希望有人可以帮助我。
我一直在做一个草图流项目,并设置了几个导航到特定屏幕的按钮(简单易用)。
现在抓住......
我在顶部制作了一个通用菜单,并在其上放了一个按钮,我想用它实现的是,如果有人点击该按钮,而不是导航到特定的屏幕,它只需导航到在Sketchflow中查看的上一个屏幕。
有人知道这是否可行?如果是这样,我将如何实现这一目标?
答案 0 :(得分:8)
使用“后退”行为。有两种简单的方法可以将此行为应用于您的按钮:
xaml应该与此类似:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:pb="clr-namespace:Microsoft.Expression.Prototyping.Behavior;assembly=Microsoft.Expression.Prototyping.Interactivity"
x:Class="SilverlightPrototype12Screens.Screen_1"
Width="640" Height="480">
<Grid x:Name="LayoutRoot" Background="White">
<Button Height="66" Margin="241,68,275,0" VerticalAlignment="Top" Content="Button">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<pb:NavigateBackAction/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Grid>
答案 1 :(得分:6)
我一直在寻找同样的问题,但我想从c#.net。
导航我找到了以下解决方案:
private void Navigate(object sender, RoutedEventArgs e)
{
Microsoft.Expression.Prototyping.Services.PlayerContext.Instance.ActiveNavigationViewModel.NavigateToScreen("WpfPrototype2Screens.Screen_2", true);
}
在此forum。