我正在尝试从 ScrollViewer 控件导航到页面:
<Button x:Name="btnViewMenu" Content="View Menu" Click="btnViewMenu_Click" Margin="0,20,0,0" CommandParameter="{Binding}" Grid.Row="3" />
private void btnViewMenu_Click(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
RestaurantLocation loc = btn.CommandParameter as RestaurantLocation;
App.CurrentRestaurantLocation = loc;
this.Frame.Navigate(typeof(SearchFormPage));
}
在搜索表单页面上,我收到此错误:
_pageKey 不能为空:
/// <summary>
/// Invoked when this page will no longer be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property provides the group to be displayed.</param>
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
var frameState = SuspensionManager.SessionStateForFrame(this.Frame);
var pageState = new Dictionary<String, Object>();
this.SaveState(pageState);
frameState[_pageKey] = pageState;
}
我导航不正确吗?这只发生在滚动查看器内部。