protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); int index = -1; if (e.Parameter == null) { recipes = App.recipes; int numRecipes = recipes.getRecipeList().Count; if (numRecipes > 0) { index = 0; } } else { recipes = (RecipeList)e.Parameter; index = recipes.getSelectedIndex(); } this.recipeListView.ItemsSource = recipes.Recipes; if (index < 0) { detailFrame.Visibility = Visibility.Collapsed; } recipeListView.SelectedIndex = index; updateLayoutFromState(AdaptiveStates.CurrentState, null); Debug.WriteLine(index); showDetailView(index); }