Search code examples
windows-8microsoft-metrowinjssnapping

How to prevent/disable snapped view for Windows 8 Metro UI applications


I have an application that really makes no sense for snapped view, as the content generally represents A4 pages of information and data collection.

Is there a way to disable snapped view for the application, or is the recommended approach to just show the application icon, while in snapped mode?


Solution

  • You cannot disable snapped view.

    Simply just create a new page and navigate to that page if a snap event occurred. You can simply display an image.

    Window.Current.SizeChanged += (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) =>
                    {
                        ApplicationViewState myViewState = ApplicationView.Value;
    
                        if (myViewState == ApplicationViewState.Snapped)
                        {
                            //await SaveAssets();
                            this.Frame.Navigate(typeof(Snapped));
                            Snapped = true;
                        }
                        else if (myViewState != ApplicationViewState.Snapped)
                        {
                            if (Snapped)
                            {
                                this.Frame.Navigate(typeof(MainPage));
                                Snapped = false;
                            }
                        }
                    };