// ViewChangeCompleted event handler for the SemanticZoom private void OnViewChangeCompleted(object sender, Windows.UI.Xaml.Controls.SemanticZoomViewChangedEventArgs e) { if (e.IsSourceZoomedInView) { // Going to zoomed out view this.nonContextualItemsPanel.Children.Add(this._linksButton); } else { // Going to zoomed in view this.nonContextualItemsPanel.Children.Remove(this._linksButton); } }
// ViewChangeStarted event handler for the SemanticZoom private void OnViewChangeStarted(object sender, Windows.UI.Xaml.Controls.SemanticZoomViewChangedEventArgs e) { // Close the app bar this.globalAppBar.IsOpen = false; if (!e.IsSourceZoomedInView) { // Unsnap the app (if necessary) before going into zoomed in view if (Windows.UI.ViewManagement.ApplicationView.Value == Windows.UI.ViewManagement.ApplicationViewState.Snapped) { if (!Windows.UI.ViewManagement.ApplicationView.TryUnsnap()) { // Could not unsnap, go back to zoomed out view this.semanticZoom.IsZoomedInViewActive = false; } } } else { // Reset the flip view's selected item so that when we go back to zoomed in view // SelectionChanged event is triggered for sure this.zoomedInFlipView.SelectedIndex = -1; } }