private void updateLayoutFromState(VisualState newState, VisualState oldState) { bool isNarrow = newState == NarrowState; if (isNarrow && oldState == DefaultState) { // window resized down if (!recipes.isEmpty()) { if (recipes.isEditing()) { // TODO: will overwrite changes that are not saved Frame.Navigate(typeof(RecipeForm), recipes, new SuppressNavigationTransitionInfo()); } else { Frame.Navigate(typeof(DetailSection), recipes, new SuppressNavigationTransitionInfo()); } } } }